A=matrix([[4,0,1],[0,1,0],[4,0,1]])
print "Given matrix A=\n",A
B=matrix([[3],[3],[5]])
print "Given matrix B=\n",B
print "Their product is given by A*B="
print A*B
C=matrix([[1,0,0],[0,1,0],[0,0,1]])
print "Given matrix C=\n",C
D=matrix([[5],[-2],[3]])
print "Given matrix D=\n",D
print "Their product is given by C*D="
print C*D
E=matrix([[2,0],[1,3]])
F=matrix([[1],[1]])
print "Given matrices are\n",
print "E=\n",E
print "F=\n",F
print "let K be a matrix which is the product of E and F\nThus K is given by"
K=E*F
print "K=\n",K
print "Plotting the resultant matrix on the graph by using plot() function"
plot(K)


Result:

Given matrix A=
[4 0 1]
[0 1 0]
[4 0 1]
Given matrix B=
[3]
[3]
[5]
Their product is given by A*B=
[17]
[ 3]
[17]
Given matrix C=
[1 0 0]
[0 1 0]
[0 0 1]
Given matrix D=
[ 5]
[-2]
[ 3]
Their product is given by C*D=
[ 5]
[-2]
[ 3]
Given matrices are
E=
[2 0]
[1 3]
F=
[1]
[1]
let K be a matrix which is the product of E and F
Thus K is given by
K=
[2]
[4]
Plotting the resultant matrix on the graph by using plot() function

Strang-1.4-1-U (last edited 2010-12-18 10:46:44 by trnkarthik)