This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

UpperTriangularize

UpperTriangularize[m]
gives a matrix in which all but the upper triangular elements of m are replaced with zeros.
UpperTriangularize[m, k]
replaces with zeros only the elements below the k^(th) subdiagonal of m.
  • In UpperTriangularize[m, k] positive k refers to subdiagonals above the main diagonal and negative k refers to subdiagonals below the main diagonal.
Get the upper triangular part of a matrix:
Get the strictly upper triangular part of a matrix:
Get the upper triangular part of a matrix:
In[1]:=
Click for copyable input
Out[1]//MatrixForm=
 
Get the strictly upper triangular part of a matrix:
In[1]:=
Click for copyable input
Out[1]//MatrixForm=
Get the upper triangular part of nonsquare matrices:
The number of rows or columns limits the meaningful values of the parameter k:
New in 7