eliminate
Eliminates variables from a system of equations.
Category: Mathematics > Equation Solving
Syntax
E = eliminate(eqs, vars)
Removes the variables vars and returns equations in the remaining ones.
Description
eliminate combines the equations algebraically, substituting the eliminated variables, so that what is left relates only the other unknowns. It needs at least as many equations as eliminated variables.
Input arguments
eqs- Vector of symbolic equations.
vars- Variables to eliminate.
Output arguments
E- Reduced equations that do not involve
vars. An expression likex - 3*zstands forx - 3*z == 0.
Example
Eliminate one variable
syms x y z
eliminate([x == y + z, y == 2*z], y)
Output
ans = x - 3*z