lt
Less than, the function form of the operator <.
Category: Symbolic Computations in MATLAB > Operators and Elementary Operations
Syntax
C = lt(A, B)
Same as A < B.
Description
The operator A < B compares element by element and returns true where A is strictly less than B. For complex numbers only the real parts are compared. Comparisons with NaN are false.
Incompatible sizes, such as a 2-by-3 and a 3-by-2 array, are an error.
Input arguments
A, B- Numeric, character or string arrays, or symbolic scalars. Sizes must be compatible (equal, or one is scalar, or broadcasting applies).
Output arguments
C- Logical array with the broadcast size. With symbolic operands, a symbolic relation such as
x > 1.
Example
Scalar against array
lt([1 2 3], 2)
lt(2, 3)
sum(lt([4 8 1 9], 5))
Output
ans = 1×3 logical array
1 0 0
ans = logical
1
ans = 2