Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Matrices and Linear Algebra > Parts of Matrices > UpperTriangularize >
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Programming > Matrices and Linear Algebra > Parts of Matrices > UpperTriangularize >
Mathematica > Visualization and Graphics > Graphs & Networks > Graph Programming > Matrices and Linear Algebra > Parts of Matrices > UpperTriangularize >

UpperTriangularize

UpperTriangularize[m]
gives a matrix in which all but the upper triangular elements of m are replaced with zeros.
UpperTriangularize
replaces with zeros only the elements below the k^(th) subdiagonal of m.
  • In UpperTriangularize, 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
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF