tr: Matrix trace

Description Usage Arguments Value Author(s) Examples

Description

Calculates the trace of a matrix

Usage

1
tr(M)

Arguments

M

a matrix

Value

returns the sum of the diagonal elements

Author(s)

Michael Friendly

Examples

1
2
M <- matrix(sample(1:9), 3,3)
tr(M)

mvinfluence documentation built on May 2, 2019, 4:58 p.m.