rhs
Right side (RHS) of equation
Syntax
Description
returns
the right side of the symbolic equation rhsEqn
= rhs(eqn
)eqn
. The value of
eqn
also can be a symbolic condition, such as x > 0. If eqn
is an array, then rhs
returns an array of the right sides of the equations in eqn
.
Conditions that use the >
or >=
operator are
internally rewritten using the <
or <=
operator.
Therefore, rhs
returns the original left side. For example, rhs(x
> 0)
returns x
.
Examples
Find Right Side of Equation
Find the right side of the equation by using rhs
.
First, declare the equation.
syms x y eqn = 2*y == x^2
eqn =
Find the right side of eqn
by using rhs
.
rhsEqn = rhs(eqn)
rhsEqn =
Find Right Side of Condition
Find the right side of the condition by using rhs
.
First, declare the condition.
syms x y cond = x < y + 1
cond =
Find the right side of cond
by using rhs
.
rhsCond = rhs(cond)
rhsCond =
Find Right Side of Equations in Array
For an array that contains equations and conditions, rhs
returns an array of the right sides of those equations or conditions. The output array is the same size as the input array.
Find the right side of the equations and conditions in the vector V
.
syms x y V = [y^2 == x^2, x ~= 0, x*y >= 1]
V =
rhsV = rhs(V)
rhsV =
Because any condition using the >=
operator is internally rewritten using the <=
operator, the sides of the last condition in V
are exchanged.
Find Right Side of Equation Involving Symbolic Matrix Variables
Find the right side of a symbolic equation that involves symbolic matrix variables.
Create the symbolic matrix variables and the symbolic equation.
syms A [2 2] matrix syms B [2 1] matrix syms C [1 2] matrix eqn = B*C == A*A - 2*A + eye(2)
eqn =
Find the right side of the equation by using rhs
.
rhsEqn = rhs(eqn)
rhsEqn =
Input Arguments
eqn
— Equation or condition
symbolic equation | symbolic condition | vector of symbolic equations or conditions | matrix of symbolic equations or conditions | multidimensional array of symbolic equations or conditions
Equation or condition, specified as a symbolic equation or condition, or a vector, matrix, or multidimensional array of symbolic equations or conditions.
Data Types: sym
| symfun
| symmatrix
| symfunmatrix
Version History
Introduced in R2017aR2022b: Find right side of symbolic equation or condition involving symbolic matrix variables and matrix functions
The rhs
function accepts a symbolic equation or condition involving
symbolic matrix variables and matrix functions as an input argument. The input data type can be
symmatrix
or symfunmatrix
. For an example, see Find Right Side of Equation Involving Symbolic Matrix Variables.
Ouvrir l'exemple
Vous possédez une version modifiée de cet exemple. Souhaitez-vous ouvrir cet exemple avec vos modifications ?
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)