### 15.3.6 LU decomposition (for TI compatibility)

The LU command finds the LU decomposition of a matrix.

- LU takes four arguments:
  - A, a numeric square matrix.
  - l,u and p, three variable names.
- LU(A) returns the matrix P from the LU decomposition of A, and assigns L, U and P to the variables l,u and p. Namely, P is a permutation matrix, L is lower triangular with ones on the diagonal, and U is upper triangular with PA=LU.

#### Example

LU([[3,5],[4,5]],L,U,P)

⎡
⎢
⎣

1 | 0
0 | 1

⎤
⎥
⎦

L,U

⎡
⎢
⎢
⎢
⎢
⎣

1 | 0

4
3

1

⎤
⎥
⎥
⎥
⎥
⎦

,

⎡
⎢
⎢
⎢
⎢
⎣

3 | 5

0

−

5
3

⎤
⎥
⎥
⎥
⎥
⎦