ProductName  

Returns the sum of the diagonal elements.

Syntax

MatrixObject.Trace

Return Value

If matrix object is a real matrix then the value returned is a Double. If matrix object is a complex matrix then the value returned is a Complex.

Remarks

Trace can be calculated only for a square matrix.

Error Codes

Error 1305 will be returned, if matrix is not square.

See Also

Applies To: Matrix | CMatrix