tril

Returns a lower triangular matrix.

Syntax

tril(X)

tril(X, k)

Inputs

X
The matrix from which to extract the result.
Dimension: matrix
k
The index of the sub or super-diagonal at which to begin (default: 0).
Type: integer
Dimension: scalar

Outputs

R
The lower triangular matrix.

Examples

tril([1,2,3,4,5;6,7,8,9,10;11,12,13,14,15])
R = [Matrix] 3 x 5
 1   0   0  0  0
 6   7   0  0  0
11  12  13  0  0
tril([1,2,3,4,5;6,7,8,9,10;11,12,13,14,15],-2)
R = [Matrix] 3 x 5
 0  0  0  0  0
 0  0  0  0  0
11  0  0  0  0
tril([1,2,3,4,5;6,7,8,9,10;11,12,13,14,15],-2)
R = [Matrix] 3 x 5
 0  0  0  0  0
 0  0  0  0  0
11  0  0  0  0