Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


ProcMod (version 1.0.8)

.Trace: Compute the trace of a square matrix.

Description

The trace of a square matrix is defined as the sum of its diagonal elements.

Usage

.Trace(X)

Arguments

X

a square matrix

Value

the trace of X

Examples

Run this code
# NOT RUN {
m <- matrix(1:16, nrow = 4)
ProcMod:::.Trace(m)
# }

Run the code above in your browser using DataLab