Right side of equations, inequalities, relations, intervals, ranges and tables
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
rhs(f
)
rhs(f)
returns the right side of f
.
The call rhs(f)
is equivalent to the direct
call op(f,2)
, of the operand function op
, if f
is
not a table.
If t
is a table, the call rhs(t)
returns
the list of values of the table (right side). Note that the i
th
value in rhs(t)
corresponds to the i
th
key in lhs(t)
.
Extract the right sides of various objects:
rhs(a <= b), rhs(m1..n+1)
The operands of an expression depend on its internal representation. In particular, a "greater" relation is always converted to the corresponding "less" relation:
y > infinity; rhs(y > infinity)
y >= 4; rhs(y >= 4)
Extract the right sides of the solution of the following system:
s := solve({x + y = 1, 2*x  3*y = 2})
map(op(s), rhs)
Calls to rhs
can be easier to read than the
equivalent calls to the operand function op
:
map(op(s), op, 2)
However, direct calls to op
must be preferred inside procedures
for higher efficiency.
delete s:
Extract the keys (left side) and values (right side) from a table:
t := table(1=2, 4=PI, 5=5.6, 19=1/2): l := lhs(t);
r := rhs(t);
Note that the i
th value corresponds to the i
th
key:
bool(r = map(lhs(t), e>t[e]))
delete t,l,r:

An equation 
f