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