Hossein
2015-12-24
The determinant of a matrix is the linear expansion of its cofactors along a row or column of that matrix. For more information please visit: https://en.wikipedia.org/wiki/Determinant
The trace of a matrix is the summation of the entries in the main diagonal.
To calculate the determinant, just plug the matrix into \( det() \) and to calculate the trace, add the entries in the main diagonal:
A=rbind(c(1,2,0),c(-3,2,1),c(1,2,1))
paste("The determinant is ",det(A))
[1] "The determinant is 8"
paste("The trace is ",A[1,1]+A[2,2]+A[3,3])
[1] "The trace is 4"
cat("the eigenvalues are", eigen(A)[[1]])
the eigenvalues are 1.233412+1.92266i 1.233412-1.92266i 1.533177+0i
t(A)
[,1] [,2] [,3]
[1,] 1 -3 1
[2,] 2 2 2
[3,] 0 1 1
“Matrix Calculator” application is easy to use. Just choose the dimension of your matrix, choose the operation you want to apply, input your matrix and click \( calculate \) button. The result will show up under \( calculate \) button.
The code is so easy to modify. You can add other algebraic operations simply by copy/paste the codes and using appropriate build-in functions.
You can find the code for this appliction on:
https://github.com/Hossein-Taghinejad/Matrix-Calculator