Contents Previous Next Subchapters

Lower Triangular Part of a Matrix
Syntax tril(A)
tril(
Ak)
See Also triu , diag , identity

Description
The syntax tril(A) returns the lower triangular part of A

The syntax tril(X,k) returns the elements on and below the k-th diagonal of A where k is an integer, real or double-precision scalar. The value k = 0 corresponds to the main diagonal, k > 0 corresponds to above the main diagonal, and k < 0 corresponds to below the main diagonal.

Example:
If you enter
     A = {[1, 2], [3, 4]}
     tril(A)
O-Matrix will respond
     {
     [ 1 , 0 ]
     [ 3 , 4 ]
     }
If you enter
     A = {[1, 2 , 3], [4, 5, 6], [7, 8, 9]}
     k = 1
     tril(A, k)
O-Matrix will respond
     {
     [ 1 , 2 , 0 ]
     [ 4 , 5 , 6 ]
     [ 7 , 8 , 9 ]
     }