WOLFRAM

gives True if m is upper triangular, and False otherwise.

gives True if m is upper triangular starting up from the k^(th) diagonal, and False otherwise.

Details and Options

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Test if a matrix is upper triangular:

Out[1]=1
Out[2]=2

Test if a matrix is upper triangular starting from the first superdiagonal:

Out[2]=2

Test if a matrix is upper triangular starting from the first subdiagonal:

Out[2]=2

Scope  (12)Survey of the scope of standard use cases

Basic Uses  (8)

Test rectangular matrices:

Out[2]=2
Out[4]=4

Test a symbolic matrix:

Out[1]=1

The matrix is upper triangular when c=0:

Out[2]=2

Test if a real machine-number matrix is upper triangular:

Out[1]=1

Test a complex matrix:

Out[1]=1

Test an exact matrix:

Out[1]=1

Test an arbitrary-precision matrix:

Out[1]=1

Test if matrices have nonzero entries starting from a particular superdiagonal:

Out[1]=1
Out[2]=2

Note that this matrix is upper triangular:

Out[3]=3

Test if matrices have nonzero entries starting from a particular subdiagonal:

Out[1]=1
Out[2]=2

Note that this matrix is not upper triangular:

Special Matrices  (4)

Test a sparse matrix:

Out[1]=1
Out[2]=2

Test structured matrices:

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

Identity matrices are upper triangular:

Out[1]=1

Hilbert matrices are not upper triangular:

Out[1]=1

Options  (1)Common values & functionality for each option

Tolerance  (1)

This matrix is not upper triangular:

Out[1]=1

Add the Tolerance option to consider numbers smaller than 10-12 to be zero:

Out[2]=2

Applications  (3)Sample problems that can be solved with this function

LUDecomposition decomposes a matrix as a product of upper and lowertriangular matrices, returned as a triple {lu,perm,cond}:

Form the canonical matrices l and u from the composite matrix lu:

Display the three matrices:

Out[4]=4

Verify that l and u are lower and upper triangular, respectively:

Out[5]=5

Reconstruct the original matrix as a permutation of the product of l and u:

Out[6]=6

SchurDecomposition gives a 2×2-block upper-triangular matrix:

Verify this matrix is upper triangular starting from the first subdiagonal:

Out[3]=3

JordanDecomposition relates any matrix to an upper-triangular matrix via a similarity transformation m=s.j.TemplateBox[{s}, Inverse]:

Visualize the three matrices:

Out[2]=2

Verify that the Jordan matrix is upper triangular and similar to the original matrix:

Out[3]=3

The matrix is diagonalizable iff its Jordan matrix is also lower triangular:

Out[4]=4

Properties & Relations  (12)Properties of the function, and connections to other functions

UpperTriangularMatrixQ returns False for inputs that are not matrices:

Out[1]=1
Out[2]=2

Matrices of dimensions {n,0} are upper triangular:

Out[1]=1

UpperTriangularize returns matrices that are UpperTriangularMatrixQ:

Out[1]=1

The inverse of an upper-triangular matrix is upper triangular:

Out[2]=2

This extends to arbitrary powers and functions:

Out[3]=3
Out[4]=4

The product of two (or more) upper-triangular matrices is upper triangular:

Out[2]=2

The determinant of a triangular matrix equals the product of the diagonal entries:

Out[2]=2
Out[3]=3

Eigenvalues of a triangular matrix equal its diagonal elements:

Out[2]=2
Out[3]=3

UpperTriangularMatrixQ[m,0] is equivalent to UpperTriangularMatrixQ[m]:

Out[1]=1
Out[2]=2

QRDecomposition gives an upper triangular matrix:

Out[2]=2

CholeskyDecomposition gives an upper triangular matrix:

Out[1]=1
Out[2]=2

HessenbergDecomposition returns a matrix that is upper triangular with an added subdiagonal:

Out[2]=2

A matrix is upper triangular starting at diagonal iff its transpose is lower triangular starting at diagonal :

Out[2]=2
Wolfram Research (2019), UpperTriangularMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html.
Wolfram Research (2019), UpperTriangularMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html.

Text

Wolfram Research (2019), UpperTriangularMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html.

Wolfram Research (2019), UpperTriangularMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html.

CMS

Wolfram Language. 2019. "UpperTriangularMatrixQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html.

Wolfram Language. 2019. "UpperTriangularMatrixQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html.

APA

Wolfram Language. (2019). UpperTriangularMatrixQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html

Wolfram Language. (2019). UpperTriangularMatrixQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html

BibTeX

@misc{reference.wolfram_2025_uppertriangularmatrixq, author="Wolfram Research", title="{UpperTriangularMatrixQ}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html}", note=[Accessed: 18-May-2025 ]}

@misc{reference.wolfram_2025_uppertriangularmatrixq, author="Wolfram Research", title="{UpperTriangularMatrixQ}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html}", note=[Accessed: 18-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_uppertriangularmatrixq, organization={Wolfram Research}, title={UpperTriangularMatrixQ}, year={2019}, url={https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html}, note=[Accessed: 18-May-2025 ]}

@online{reference.wolfram_2025_uppertriangularmatrixq, organization={Wolfram Research}, title={UpperTriangularMatrixQ}, year={2019}, url={https://reference.wolfram.com/language/ref/UpperTriangularMatrixQ.html}, note=[Accessed: 18-May-2025 ]}