Question: I need a bash shell script that multiplies 2 matrices from a file. It will have a multiply function that takes an MxN and NxP

I need a bash shell script that multiplies 2 matrices from a file. It will have a multiply function that takes an MxN and NxP matrix and produce an MxP matrix. Note that, unlike addition, matrix multiplication is not commutative. That is A*B != B*A.

Here is a brief example of what the output should look like.

matrix 1 (m1):

1 2 3 4 5 6 7 8 matrix 2 (m2): 
1 2 3 4 5 6 7 8

When the multiply function is ran, it should output like this:

$ ./matrix multiply m1 m2 50 60 114 140

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!