eliminate
Eliminate variables from rational equations
Description
Examples
Eliminate Variables from Rational Equations
Create two rational equations that contain the variables x
and y
.
syms x y eqns = [x*y/(x-2) + y == 5/(y - x), y-x == 1/(x-1)]
eqns =
Eliminate the variable x
. The result is a symbolic expression that is equal to zero.
expr = eliminate(eqns,x)
expr =
Eliminate Variables from Polynomial Equations
Create two polynomial equations that contain the variables x
and y
.
syms x y eqns = [2*x+y == 5; y-x == 1]
eqns =
Eliminate the variable x
from the equations. The result is a symbolic expression that is equal to zero.
expr = eliminate(eqns,x)
expr =
Now, create three polynomial equations that contain the variables x
, y
, and z
. Eliminate the variable x
. The result is a vector of symbolic expressions that is equal to zero.
syms z
eqns = [x^2 + y-z^2 == 2;
x - z == y;
x^2 + y^2-z == 4];
expr = eliminate(eqns,x)
expr =
To eliminate both x
and y
, use the eliminate
function and specify the two variables as the vector [x y]
.
expr = eliminate(eqns,[x y])
expr =
Input Arguments
eqns
— Rational equations
vector of symbolic equations | vector of symbolic expressions
Rational equations, specified as a vector of symbolic equations or symbolic expressions. A rational equation is an equation that contains at least one fraction in which the numerator and the denominator are polynomials.
The relation operator ==
defines symbolic
equations. If a symbolic expression eqn
in
eqns
has no right side, then a symbolic equation with
a right side equal to 0
is assumed.
vars
— Variables to eliminate
vector of symbolic variables
Variables to eliminate, specified as a vector of symbolic variables.
Version History
Introduced in R2018a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)