Main Content

ge

Define greater than or equal to condition

Syntax

Description

example

A>=Bcreates the condition greater than or equal.

ge(A,B)相当于A >= B.

Examples

collapse all

Set the assumption thatxis greater than or equal to 3 by usingassume.

syms x assume(x >= 3)

Solve this equation involvingx. The solver only returns solutions that are valid under the assumption onx.

eqn = (x-1)*(x-2)*(x-3)*(x-4) == 0; solve(eqn,x)
ans = 3 4

Set the conditionabs(sin(x)) >= 1/2.

syms x cond = abs(sin(x)) >= 1/2;

Find multiples ofπ/24that satisfy the condition by using aforloop from0toπ.

for i = 0:sym(pi/12):sym(pi) if subs(cond,x,i) disp(i) end end
pi/6 pi/4 pi/3 (5*pi)/12 pi/2 (7*pi)/12 (2*pi)/3 (3*pi)/4 (5*pi)/6

Input Arguments

collapse all

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

Tips

  • Calling>=orgefor non-symbolicAandBinvokes the MATLAB®gefunction. This function returns a logical array with elements set to logical1 (true)whereAis greater than or equal toB; otherwise, it returns logical0 (false).

  • If bothAandBare arrays, then these arrays must have the same dimensions.A >= Breturns an array of relationsA(i,j,...) >= B(i,j,...)

  • If one input is scalar and the other an array, then the scalar input is expanded into an array of the same dimensions as the other array.

  • The field of complex numbers is not an ordered field. MATLAB projects complex numbers in relations to a real axis. For example,x >= ibecomesx >= 0, andx >= 3+2*ibecomesx >= 3.

Version History

Introduced in R2012a

See Also

|||||