Main Content

lt

Define less than relation

Description

A < B creates a less than relation.

example

lt(A,B) is equivalent to A < B.

Examples

Set and Use Assumption Using Less

Use assume and the relational operator < to set the assumption that x is less than 3:

syms x
assume(x < 3)

Solve this equation. The solver takes into account the assumption on variable x, and therefore returns these two solutions.

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

Find Values that Satisfy Condition

Use the relational operator < to set this condition on variable x:

syms x
cond = abs(sin(x)) + abs(cos(x)) < 6/5;

Use the for loop with step π/24 to find angles from 0 to π that satisfy that condition:

for i = 0:sym(pi/24):sym(pi)
  if subs(cond, x, i)
    disp(i)
  end
end
0
pi/24
(11*pi)/24
pi/2
(13*pi)/24
(23*pi)/24
pi

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 < or lt for non-symbolic A and B invokes the MATLAB® lt function. This function returns a logical array with elements set to logical 1 (true) where A is less than B; otherwise, it returns logical 0 (false).

  • If both A and B are arrays, then these arrays must have the same dimensions. A < B returns an array of relations A(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. In other words, if A is a variable (for example, x), and B is an m-by-n matrix, then A is expanded into m-by-n matrix of elements, each set to x.

  • The field of complex numbers is not an ordered field. MATLAB projects complex numbers in relations to a real axis. For example, x < i becomes x < 0, and x < 3 + 2*i becomes x < 3.

Version History

Introduced in R2012a