Contents Previous Next Subchapters Current Chapters-> identity zeros ones fill fillcols fillrows seq toeplitz vander hankel hilb invhilb diag tril triu novalue Parent Chapters-> Omatrix6 elementary specialmatrices tril Search Tools-> contents reference index search

Lower Triangular Part of a Matrix
 Syntax `tril(`A```) tril(```A`, `k`)` 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 ]      } ```