Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


Correlplot (version 1.1.0)

tr: Compute the trace of a matrix

Description

tr computes the trace of a matrix.

Usage

tr(X)

Value

the trace (a scalar)

Arguments

X

a (square) matrix

Author

Jan Graffelman (jan.graffelman@upc.edu)

Examples

Run this code
X <- matrix(runif(25),ncol=5)
print(X)
print(tr(X))

Run the code above in your browser using DataLab