Skip to Main Content Skip to Search
Product Documentation

trace - Sum of diagonal elements

Syntax

b = trace(A)

Description

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

Algorithms

t = sum(diag(A));

See Also

det | eig

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS