Mathematica > Mathematics and Algorithms > Matrices and Linear Algebra > Parts of Matrices >

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.
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team