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.

Recommended Answers

All 2 Replies

I'm sure someone will help you fixr for loops - but since we're not mind readers you'll have to post your current code

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.