A=matrix([[1,4,-1],[1,1,1],[2,0,3]]);
print "\n Matrix A:\n",A
B=matrix([[1],[0],[0]])
print "\n Matrix B:\n",B
C=matrix(3)
D=matrix(3)
E=matrix(3)
C=C+A
D=D+A
E=E+A
C[0,0]=B[0,0]
C[1,0]=B[1,0]
C[2,0]=B[2,0]
x=C.det()
D[0,1]=B[0,0]
D[1,1]=B[1,0]
D[2,1]=B[2,0]
y=D.det()

E[0,2]=B[0,0]
E[1,2]=B[1,0]
E[2,2]=B[2,0]
z=E.det()

print "\n Value of X=",x

print "\n Value of Y=",y

print "\n Value of Z=",z

Kreyszig-4.4.7(b)-U (last edited 2010-12-18 07:59:11 by B lavanya)