| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Symbolic Math Toolbox |
| Contents | Index |
| Learn more about Symbolic Math Toolbox |
tril(A)
tril(A, k)
tril(A) returns a triangular matrix that retains the lower part of the matrix A. The upper triangle of the resulting matrix is padded with zeros.
tril(A, k) returns a matrix that retains the elements of A on and below the k-th diagonal. The elements above the k-th diagonal equal to zero. The values k = 0, k > 0, and k < 0 correspond to the main, superdiagonals, and subdiagonals, respectively.
Display the matrix retaining only the lower triangle of the original symbolic matrix:
syms a b c A = [a b c; 1 2 3; a + 1 b + 2 c + 3]; tril(A)
The result is:
ans = [ a, 0, 0] [ 1, 2, 0] [ a + 1, b + 2, c + 3]
Display the matrix that retains the elements of the original symbolic matrix on and below the first superdiagonal:
syms a b c A = [a b c; 1 2 3; a + 1 b + 2 c + 3]; tril(A, 1)
The result is:
ans = [ a, b, 0] [ 1, 2, 3] [ a + 1, b + 2, c + 3]
Display the matrix that retains the elements of the original symbolic matrix on and below the first subdiagonal:
syms a b c A = [a b c; 1 2 3; a + 1 b + 2 c + 3]; tril(A, -1)
The result is:
ans = [ 0, 0, 0] [ 1, 0, 0] [ a + 1, b + 2, 0]
![]() | taylortool | triu | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |