Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

trace - Sum of diagonal elements

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

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS