TRIL

Purpose:

Returns the lower triangle of a matrix.

Syntax:

TRIL(a, d)

a

-

A matrix.

d

-

Optional. An integer, the diagonal on and below which to include matrix elements. Defaults to 0, the main diagonal.

Returns:

An array consisting of the lower triangle of a where the other elements are zero.

Example:

W1: {{1, 2, 3},

     {4, 5, 6}, 

     {7, 8, 9}} 

 

W2: tril(W1)

 

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

       {4, 5, 0}, 

       {7, 8, 9}} 

 

 

W3: tril(W1, 1)

 

W3 == {{1, 2, 0},

       {4, 5, 6}, 

       {7, 8, 9}} 

 

 

W4: tril(W1, -1)

 

W4 == {{0, 0, 0},

       {4, 0, 0}, 

       {7, 8, 0}} 

 

Remarks:

TRIL(a, -1) is equivalent to LOTRIX(a).

 

See TRIU to return the upper matrix.

See Also:

COLNOS

DIAGONAL

LOTRIX

ROWNOS

TRIU

UPTRI

UPTRIX