matrix.trace {matrixcalc} | R Documentation |
This function returns the trace of a given square numeric matrix.
matrix.trace(x)
x |
a matrix |
A numeric value which is the sum of the values on the diagonal.
If the argument A is not a square matrix, then the function presents an error message and stops.
Frederick Novomestky fnovomes@poly.edu
A <- matrix( seq( 1, 16, 1 ), nrow=4, byrow=TRUE ) matrix.trace( A )