|
Contents | Previous | Next | Subchapters |
| Syntax |
[L,U] = lu(X) |
[L,U, P] = lu(X) | |
| See Also | qred , svd , schur |
X = L * U
where X is a real, double-precision or complex
square matrix
.
L
is a matrix with the same type and dimension as X.
If the argument P is present,
L is a
lower triangular
matrix
with ones along the diagonal.
If the argument P is not present,
there is a
permutation matrix
P such that P * L is lower triangular
with ones along the diagonal.
U
is an
upper triangular
matrix
with the same type and dimension as X.
P
If the argument P is present, it is a
permutation matrix
and
P * X = L * U
(Note that this equation can also be written as X = (P' * X) * U
and P' corresponds to the permutation matrix mentioned for the
case where the argument P is not present.)
x = {[1., .5], [.5, 1.]}
[l, u] = lu(x)
print l * u
O-Matrix will respond
{
[ 1 , .5 ]
[ .5 , 1 ]
}
which is equal to the matrix x.
If you continue by entering
print l
O-Matrix will respond
{
[ 1 , 0 ]
[ .5 , 1 ]
}
If you then enter
print u
O-Matrix will respond
{
[ 1 , .5 ]
[ 0 , .75 ]
}