Previous Up Next

15.1.3  Trace of a matrix

The trace of a square matrix is the sum of the diagonal elements. The trace command finds the trace of a matrix.

Example

trace([[1,2],[3,4]])
     
5           

Previous Up Next