B=matrix([[1,3],[1,1]])
print 'given matrix is '
print B
print 'transpose of given matrix is'
print B.transpose()
A=B+B.transpose()
print 'A=B+B.transpose is'
print A
x1=A.transpose()
print 'A.transpose is'
print x1
if A==x1:
    print 'as A=A.transpose,A is symmetric matrix'
K=B-B.transpose()
print 'K=B-B.transpose is'
print K
print 'K transpose is'
print K.transpose()
if -K==K.transpose() :
    print 'K is skew-symmetic'
B=(1/2)*(A+K)
print '---B as sum of symmetric and skew-symmetric'
print B

Strang-1.6-14-U (last edited 2010-12-18 08:04:07 by jejiramchand)