Calculates the trace of a matrix
tr(mat)
mat
a square matrix.
The trace of the matrix, i.e. the sum of its diagonal elements, is returned.
tr(cbind(1,1:3,4:2)) # 5