Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


lava (version 1.4.5)

tr: Trace operator

Description

Calculates the trace of a square matrix.

Usage

tr(x, ...)

Arguments

x
Square numeric matrix
...
Additional arguments to lower level functions

Value

numeric

See Also

crossprod, tcrossprod

Examples

Run this code

tr(diag(1:5))

Run the code above in your browser using DataLab