A = Matrix([[2,1],[1,7]])
B = Matrix([[-2,5],[0,8]])
C = Matrix([[6,0,3],[1,0,-5]])
print  A+B
print 
print  B+A
print 
#print A+B+C
print "(iii) cannot be obtained as dimensions of C are different from the other 2"

SageDays/Kreyszig-6.1--1 (last edited 2010-08-12 10:20:15 by msunyuma)