You can modify the program if you like. Some ideas are:

- Modify the program using Functions/Procedures.
- Modify the program such that it can compute the product for any size of two matrices provided the number of columns of first matrix is equal to the number of rows of the second matrix.

When I do the multiplication, I get

ReplyDelete[30 23 19 ]

[84 65 58 ]

[138 107 97 ]

What could be going on that my calculation is close but differs from yours?

This site agrees with me:

Deletehttp://wims.unice.fr/wims/wims.cgi?session=27170A9888.1&lang=en&cmd=reply&module=tool%2Flinear%2Fmatmult.en&matA=1%2C+2%2C+3%0D%0A4%2C+5%2C+6%0D%0A7%2C+8%2C+9&matB=9%2C+7%2C+8%0D%0A6%2C+5%2C+4%0D%0A3%2C+2%2C+1&show=A*B

Hi Tom. I just rechecked the program and got the same answer as before. You can view the screenshot here - http://goo.gl/d06oNH I guess the problem is your input. Check! In this case, when prompted to enter the elements for matrix A, type 1 then press ENTER, type 2 and press ENTER, to 9. For matrix B, type 9 then press ENTER, type 8 and press ENTER, to 1. I also solved the problem manually on paper just to make sure it was correct. Also check your code.

DeleteI found the difference: I was going by your image, which has 978 instead of 987 in the top row. Funny :D

ReplyDelete