lu
L-U decomposition of a matrix.
(P, U)=lu(a)
(L, U, E)=lu(a)
Inputs
a Any matrix.
Outputs
L A lower triangular matrix if E is used in the call, or a row permutation of a lower triangular matrix.
U An upper triangular matrix.
E A matrix that specifies row permutations.


Description
For an mXn input matrix, L is a square mXm matrix and U is an mXn matrix.

If three outputs are used in the all, the results satisfy E'*L*U=a . Otherwise the identity P*U=a holds, of course, within the numerical precision and the accuracy of the computations.
Example
>>a=[1 2 3 ;5 6 7 ; 9  10 11];
>>(l,u, e)=lu(a)
>>(p,w)=lu(a)
>>l
    1.0000         0         0
    0.1111    1.0000         0
    0.5556    0.5000    1.0000

>>p
    0.1111    1.0000         0
    0.5556    0.5000    1.0000
    1.0000         0         0

>>u
    9.0000   10.0000   11.0000
         0    0.8889    1.7778
         0         0         0

>>w
    9.0000   10.0000   11.0000
         0    0.8889    1.7778
         0         0         0

>>norm(e'*l*u-a)
0
>>norm(p*u-a)
0