Last data update: 2014.03.03
|
R: Matrix trace
Matrix trace
Description
Calculates the trace of a matrix
Usage
tr(M)
Arguments
Value
returns the sum of the diagonal elements
Author(s)
Michael Friendly
Examples
M <- matrix(sample(1:9), 3,3)
tr(M)
Results
|