Learn R Programming

emulator (version 1.2-21)

tr: Trace of a matrix

Description

Returns the trace of a matrix

Usage

tr(a)

Arguments

a

Matrix whose trace is desired

Author

Robin K. S. Hankin

Examples

Run this code
tr(matrix(1:9,3,3))

Run the code above in your browser using DataLab