Learn R Programming

ThreeWay (version 1.1.3)

tr: Trace

Description

Computes the trace of a matrix.

Usage

tr(a)

Arguments

a
Matrix

Value

t
Trace of A

Examples

Run this code
X <- matrix(rnorm(6*6),ncol=6)
trace <- tr(X)

Run the code above in your browser using DataLab