upmat, upmat1¶
Purpose¶
Returns the upper portion of a matrix. upmat()
returns the main diagonal and every element above.
upmat1()
is the same except it replaces the main diagonal with ones.
Format¶
Examples¶
x = { 7 2 -1,
2 3 -2,
4 -2 8 };
u = upmat(x);
u1 = upmat1(x);
The resulting matrices are:
7 2 -1 1 2 -1
u = 0 3 -2 u1 = 0 1 -2
0 0 8 0 0 1
Source¶
diag.src