tril

  • tril(X) returns the lower triangular matrix of X
  • tril(X,k) returns the elements of X, on and below its k-th diagonal

Examples

> X = ones(3)

[X:3x3 double]

> tril(X)#

             1     0     0
             1     1     0
             1     1     1

> tril(X,-1)#

             0     0      0
             1     0      0
             1     1      0

> tril(X, 1)#

             1     1     0
             1     1     1
             1     1     1

Resources

See also

diag | ismatrix | triu