A=matrix([[0,7,3],[2,8,1],[-5,2,-9]]) # Coefficients of the variables
print 'Matrix=\n',A
b = vector([-12,0,26]) 
sol = A.solve_right(b)# Solution of the Matrix
A * sol
x, y,z = var('x, y,z')
print "\nResult of the Expressions:"
solve([0*x+7*y+3*z==-12, 
       2*x+8*y+1*z==0,
       -5*x+2*y-9*z==26], x, y,z)# Displaying the Values of x, y and z

SageDays/Kreyszig-6.3-4 (last edited 2010-08-11 14:02:12 by Mahesh Goheja)