Returns the upper triangle of a matrix, including the main diagonal.
UPTRI(a)
a |
- |
A matrix. |
An array of size(a) consisting of the upper triangle of a, including the main diagonal, with the other elements set to 0.
W1: ones(3)
W2: uptri(W1)
W2 == {{1, 1, 1},
{0, 1, 1},
{0, 0, 1}}
UPTRI includes the main diagonal. Use UPTRIX to exclude the main diagonal.
Use TRIU to return the upper matrix above a specified diagonal.