ToolsForCoDa (version 1.0.2)

tr: 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)

Examples

Run this code
# NOT RUN {
X <- matrix(runif(25),ncol=5)
print(X)
print(tr(X))
# }

Run the code above in your browser using DataLab