tr: Obtain the Trace of a Square Matrix

Description Usage Arguments Value Author(s) Examples

View source: R/mat.R

Description

Calculates and returns the trace of a square matrix.

Usage

1
tr(x)

Arguments

x

A matrix that is square e.g. N x N

Value

A matrix with circles imprinted within its dimensions.

Author(s)

James Balamuta

Examples

1
2
# I_2 matrix
tr(diag(2))

jjb documentation built on Jan. 8, 2020, 5:07 p.m.