How do you find the dot product of 2 matrixes with:
matrix 1 has arbitrary rows and arbitrary columns- user will input rows and columns, same for matrix 2 (to multiply, rows of matrix 1 must be the columns size of matrix 2 and column size of matrix1 must be the row size of matrix 2- example:matrix1[3][4], matrix2[4][3]). The results should be returned in a new matrix 3. Matrix3 should be printed in the form matrix3[3][4]. I get lost in the for loops.

4 Years
Discussion Span
Last Post by stevelg

I suspect your first problem is in the definition of the dot product. You say the result is a third matrix of size [3][4] which in your example is wrong.
Generally two matrics of size [i][j] and [j][k] give a result of size [i][k] formed from the total of the prodcuts of the jth column and the jth row.
The for loops follow from there.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.