tr: Obtain the Trace of a Square Matrix

View source: R/mat.R

trR Documentation

Obtain the Trace of a Square Matrix

Description

Calculates and returns the trace of a square matrix.

Usage

tr(x)

Arguments

x

A matrix that is square e.g. N \times N

Value

A matrix with circles imprinted within its dimensions.

Author(s)

James Balamuta

Examples

# I_2 matrix
tr(diag(2))

coatless/balamuta documentation built on Nov. 16, 2023, 5:30 a.m.