| MATLAB Function Reference | Search  Help Desk |
| trace | See Also |
Syntax
b = trace(A)
Description
b = trace(A)
is the sum of the diagonal elements of the matrix A.
Algorithm
trace is a single-statement M-file.
t = sum(diag(A));
See Also
det, eig