MATLAB Function Reference    
trace

Sum of diagonal elements

Syntax

Description

b = trace(A) is the sum of the diagonal elements of the matrix A.

Algorithm

trace is a single-statement M-file.

See Also

det, eig


  toeplitz trapz