Learn R Programming

matrixNormal (version 0.1.1)

tr: Matrix Trace

Description

Computes the trace of a square numeric matrix A.

Usage

tr(A)

Arguments

A

Square matrix.

See Also

Other matrix: special.matrix, vec()

Examples

Run this code
A <- matrix(seq(1, 16, 1), nrow = 4, byrow = TRUE)
A
tr(A)
tr(I(3))

Run the code above in your browser using DataLab