Question: matrix question

i have 2 matrices :    |1 2 3|     |1 2 3|
                               |4 5 6|     |4 5 6|
i have to multiply there 2 matrices like below

a= (1*6)+(1*5)+(1*4)+(1*3)+(1*2)+(1*1)=21
b= (2*6)+(2*5)+(2*4)+(2*3)+(2*2)+(2*1)=42
c= (3*6)+(3*5)+(3*4)+(3*3)+(3*2)+(3*1)=63
d= (4*6)+(4*5)+(4*4)+(4*3)+(4*2)+(4*1)=84
e= (5*6)+(5*5)+(5*4)+(5*3)+(5*2)+(5*1)=105
f= (6*6)+(6*5)+(6*4)+(6*3)+(6*2)+(6*1)=126

and the result should be this matrix   |21    42    63|
                                                      |84   105  126|

 

how do you write a procedure to solve this?
this is what i did so far

mult:=proc(A::Matrix,B::Matrix)
local i,j,k,q,n,C;
C:=Matrix(RowDimension(A),ColumnDimension(B));
for i from 1 to RowDimension(A) do
for j from 1 to ColumnDimension(B) do
for q from 1 to ColumnDimension(A) do

C[i,j]:=  ?   this is where i got stuck

od;
od;
od;
return C[i,j];
end proc;

help please

Please Wait...