HyperMath

trace

trace

Previous topic Next topic No expanding text in this topic  

trace

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Compute the trace of a matrix.

Syntax

t = trace(m)

Argument

Name

Description

 

m

A scalar or a matrix.

Output

Name

Description

 

t

The trace m (sum of the diagonal elements of m).

Example

Compute the trace of the matrix.

 

Syntax

 

t = trace([1,2;3,4])

 

Result

 

t = 5

See Also:

Diag

Sum