tr: Trace operator

trR Documentation

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

Author(s)

Klaus K. Holst

See Also

crossprod, tcrossprod

Examples


tr(diag(1:5))

kkholst/lava documentation built on Feb. 22, 2024, 4:07 p.m.