Learn R Programming

jjb (version 0.1.1)

tr: 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.

Examples

Run this code
# NOT RUN {
# I_2 matrix
tr(diag(2))
# }

Run the code above in your browser using DataLab