tr: Compute the trace of a matrix

View source: R/tr.R

trR Documentation

Compute the trace of a matrix

Description

tr computes the trace of a matrix.

Usage

tr(X)

Arguments

X

a (square) matrix

Value

the trace (a scalar)

Author(s)

Jan Graffelman (jan.graffelman@upc.edu)

Examples

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

Correlplot documentation built on March 7, 2023, 8:33 p.m.