pls let me know the logic for multiplying a matrix...i have been racking my brains on that

# Matrix Multiplication

0

please could you elaborate your question?

0

If the former then it's just a case of multiplying each element by that number. a{p,q,r} = {ap,aq,ar}.

Multiplying two matrices is more involved, first you must check that the number of columns in the first equals the number of rows in the second, then:

[a0 a1] [b0 b1 b2] = [a0b0+a1b3 a0b1+a1b4 a0b2+a1b5 ]

[a2 a3] [b3 b4 b5] [a2b0+a3b3 a2b1+a2b4 a2b2+a3b5 ]

Is it the maths you're stuck on or the implementation?

0

0

[ 1 2 ] [ 5 6 7 ]

[ 3 4 ] [ 8 9 0 ]

how far do you get with "write a program to multiply them"? Do you at least get a main function?

Obviously you'll need some way to represent the matrices, you're correct to use arrays, that's exactly what they're designed for, and you're not going to be able to do this generically without some kind of loop.

Have you figured out how to store the matrices in the arrays yet?

0

i have taken the two input matrix matrix declared as a[3][3] b[3][3] using loop

n use 3 for loops,one inside other

i,j,k,initiated thm at zero, & i<=2,j<=2, k<=0

n used

C[i][j]=c[i][j]+a[i][j]*b[j][k]

is it correct?

0