Here are some commands for computing basic matrix operations, such as addition, scalar multiplication, matrix multiplication, transpose, trace, inverse, rank, rref, determinant, eigenvalues, and eigenvectors.
Basically, after you have entered the matrix, you just type A.command() to get what you want.
<sagecell> A=matrix(2,2,[1,2,3,4]) B=matrix(2,3,[1,2,3,4,5,6]) C=matrix(2,2,[-2,1,0,5])
A+2*C #Addition and Scalar Multiplication A*B #Matrix Multiplication A.transpose() A.trace() A.inverse() A.rank() A.inverse() A.determinant() A.eigenvalues() A.eigenvectors_right()
- Whatever you type last will show up. If you want something else to show up, then you can use 'print()'
print(A.trace()) </sagecell>