tr {qwalkr}R Documentation

The Trace of a Matrix

Description

Computes the trace of a matrix A.

Usage

tr(A)

Arguments

A

a square matrix.

Value

If AA has order nn, then tr(A)=i=1naiitr(A) = \sum_{i=1}^{n}a_{ii}.

See Also

J(), trdot(), cartesian()

Examples

A <- rbind(1:5, 2:6, 3:7)

# Calculate the trace of A
tr(A)

[Package qwalkr version 0.1.0 Index]