DADiSP Worksheet Functions > Function Categories > Matrix Math and Special Matrices > UPTRIX

 

UPTRIX

Purpose:

Returns the upper triangle of a matrix, excluding the main diagonal

Syntax:

UPTRIX(a)

a

-

A matrix.

Returns:

An array of size(a) consisting of the upper triangle of a, excluding the main diagonal, with the other elements set to 0.

Example:

W1: ones(3)

W2: uptrix(W1)

 

W2 == {{0, 1, 1},

       {0, 0, 1}, 

       {0, 0, 0}} 

Remarks:

UPTRIX excludes the main diagonal. Use UPTRI to include the main diagonal.

 

Use TRIU to return the upper matrix above a specified diagonal.

See Also:

COLNOS

LOTRI

LOTRIX

ROWNOS

TRIU

UPTRI