Member of the linalgebra class.
l = lu(a)
[l, u] = lu(a)
[l, u, p] = lu(a)
Decomposes a square matrix into upper and lower triangular matrices using Gaussian factorization.
| Name | Description |
| a | Specifies a square matrix. |
| Name | Description |
| l | Returns a permuted, lower triangular matrix. If you specify [l, u, p] = lu(a), l returns the lower triangular matrix with 1 on the diagonal such that l*u = p*a. If you specify [l, u] = lu(a), l returns a matrix equal to p'*m, where m is the lower triangular matrix with 1 on the diagonal. If you specify l = lu(a), l returns the strict lower triangle of the lower triangular matrix and the upper triangle of u in the same matrix. l is a matrix of the same size as a. |
| u | Returns an upper triangular matrix such that l*u = p*a. u is a matrix of the same size as a. |
| p | Returns a permutation matrix such that l*u = p*a. The LU-factorization of p'*a thus works without row interchanges. |
A = [-6, 17; 3, 8]
[L, U] = lu(A)
B = L*U