A=matrix([[5,3,2,1,6][4,5,6,7,2],[3,2,1,4,1]])
B=matrix([[5,3,2],[1,6,4],[5,6,7],[2,3,2],[1,4,1]])
C=matrix([[5],[4],[6],[7],[8]])
D=matrix([[4],[6],[8]])
print A*B
print B*A
//multiplication is possible
print AB*D
//multiplication is possible
print D*BA
//multiplication is not possible
print A(B+c)
//multiplication is not possible
//the no of rows of first row is equal to no of coloumns in second row then only the multiplication is possible 

Strang-1.4-32-U (last edited 2010-12-18 12:08:34 by 10)