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

SageDays/Kreyszig-6.3-5 (last edited 2010-08-12 12:44:45 by Mahesh Goheja)