Determine if matrix is lower triangular
tf = istril(A)
Create a 5-by-5 matrix.
D = tril(magic(5))
D = 17 0 0 0 0 23 5 0 0 0 4 6 13 0 0 10 12 19 21 0 11 18 25 2 9
D to see if it is lower triangular.
ans = 1
The result is logical
true) because all elements above the main diagonal are zero.
A matrix is lower triangular if all elements above the main diagonal are zero. Any number of the elements on the main diagonal can also be zero.
For example, the matrix
is lower triangular. A diagonal matrix is both upper and lower triangular.
to produce lower triangular matrices for which
istril are special cases of the function
isbanded, which can perform all of the
same tests with suitably defined upper and lower bandwidths. For example,