tr: Matrix Trace

Description Usage Arguments Note See Also Examples

View source: R/tr.R

Description

Computes the trace of a square numeric matrix A.

Usage

1
tr(A)

Arguments

A

Square matrix.

Note

If the argument is not a square numeric matrix, the function presents an error and terminates.

See Also

Other matrix: special.matrix, vec()

Examples

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

phargarten2/matrixNormal documentation built on Dec. 31, 2021, 12:06 a.m.