[TOC]
trace
Trace of a matrix
Usage
trace(A)
A
should be a square numeric matrix.
It returns the trace of
A
, i.e.,
sum(diag(A))
.
If
A
is a character matrix, it is converted to a double matrix before computing the trace.
If
A
is empty, it returns 0.