tr
From lasso2 v1.2-0
by Martin Maechler
Trace of a Matrix
Calculates the trace of a matrix
- Keywords
- math
Usage
tr(mat)
Value
The trace of the matrix, i.e. the sum of its diagonal elements, is returned.
Examples
tr(cbind(1,1:3,4:2)) # 5
Community examples
Looks like there are no examples yet.