Method on @sym: [L, U] = lu (A)
Method on @sym: [L, U, P] = lu (A)
Method on @sym: […] = lu (A, 'vector')

Symbolic LU factorization of a matrix.

Example:

A = sym([1 2; 3 4]);

[L, U] = lu (A)
  ⇒ L = (sym 2×2 matrix)

      ⎡1  0⎤
      ⎢    ⎥
      ⎣3  1⎦

  ⇒ U = (sym 2×2 matrix)

      ⎡1  2 ⎤
      ⎢     ⎥
      ⎣0  -2⎦

See also: lu, @sym/qr.

Package: symbolic