e-Mathematics > Matrix Algebra

Matlab/Octave

Matlab/Octave. The function lu(A) completes the LU factorization only for a square matrix A, and returns a lower triangular matrix $ L$, an upper triangular matrix $ U$, and a (permutation) matrix $ P$. Since it returns three matrices at once, the returned matrices must be specified as in the following form:
> [L, U, P] = lu(A)

EXAMPLE 1. Find an LU factorization of $ U = \begin{bmatrix}
1 & 4 &-1 & 5 \\
3 & 7 &-2 & 9 \\
-2 &-3 & 1 &-4 \\
-1 & 6 &-1 & 7
\end{bmatrix}$


© TTU Mathematics