@sym
: mldivide (A, b) ¶@sym
: A \ b ¶Symbolic backslash: solve symbolic linear systems.
This operator tries to broadly match the behaviour of the backslash operator for double matrices. For scalars, this is just division:
sym(2) \ 1 ⇒ ans = (sym) 1/2
But for matrices, it solves linear systems
A = sym([1 2; 3 4]); b = sym([5; 11]); x = A \ b ⇒ x = (sym 2×1 matrix) ⎡1⎤ ⎢ ⎥ ⎣2⎦ A*x == b ⇒ ans = (sym 2×1 matrix) ⎡True⎤ ⎢ ⎥ ⎣True⎦
Over- and under-determined systems are supported:
A = sym([5 2]); x = A \ 10 ⇒ x = (sym 2×1 matrix) ⎡ 2⋅c₁⎤ ⎢2 - ────⎥ ⎢ 5 ⎥ ⎢ ⎥ ⎣ c₁ ⎦ A*x == 10 ⇒ ans = (sym) True
A = sym([1 2; 3 4; 9 12]); b = sym([5; 11; 33]); x = A \ b ⇒ x = (sym 2×1 matrix) ⎡1⎤ ⎢ ⎥ ⎣2⎦ A*x - b ⇒ ans = (sym 3×1 matrix) ⎡0⎤ ⎢ ⎥ ⎢0⎥ ⎢ ⎥ ⎣0⎦
See also: @sym/ldivide, @sym/mrdivide.
Package: symbolic