Define less than or equal to relation
In previous releases, le
in some cases
evaluated inequalities involving only symbolic numbers and returned
logical 1
or 0
. To obtain the
same results as in previous releases, wrap inequalities in isAlways
.
For example, use isAlways(A <= B)
.
A <= B
le(A,B)

Number (integer, rational, floatingpoint, complex, or symbolic), symbolic variable or expression, or array of numbers, symbolic variables or expressions. 

Number (integer, rational, floatingpoint, complex, or symbolic), symbolic variable or expression, or array of numbers, symbolic variables or expressions. 
Use assume
and the relational
operator <=
to set the assumption that x
is
less than or equal to 3:
syms x assume(x <= 3)
Solve this equation. The solver takes into account the assumption
on variable x
, and therefore returns these three
solutions.
solve((x  1)*(x  2)*(x  3)*(x  4) == 0, x)
ans = 1 2 3
Use the relational operator <=
to set
this condition on variable x
:
syms x cond = (abs(sin(x)) <= 1/2);
for i = 0:sym(pi/12):sym(pi) if subs(cond, x, i) disp(i) end end
Use the for
loop with step π/24 to
find angles from 0 to π that satisfy that condition:
0 pi/12 pi/6 (5*pi)/6 (11*pi)/12 pi
You can also define this relation by combining an equation and
a less than relation. Thus, A <= B
is equivalent
to (A < B)  (A == B)
.