tr: Compute the trace of a matrix

Description Usage Arguments Value Author(s) Examples

Description

tr computes the trace of a matrix.

Usage

1
tr(X)

Arguments

X

a (square) matrix

Value

the trace (a scalar)

Author(s)

Jan Graffelman (jan.graffelman@upc.edu)

Examples

1
2
3
X <- matrix(runif(25),ncol=5)
print(X)
print(tr(X))

ToolsForCoDa documentation built on Sept. 20, 2021, 5:19 p.m.