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.

More About

expand all

Algorithms

t = sum(diag(A));

See Also

|

Introduced before R2006a

Was this topic helpful?