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.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

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=
New in 7
New to Mathematica? Find your learning path »
Have a question? Ask support »