A <= B returns
a logical array with elements set to logical 1 (true)
where A is less than or equal to B;
otherwise, the element is logical 0 (false).
The test compares only the real part of numeric arrays. le returns
logical 0 (false) where A or B have
NaN or undefined categorical elements.

le(A,B) is
an alternate way to execute A <= B, but is rarely
used. It enables operator overloading for classes.

A — Left array scalar | vector | matrix | multidimensional array

Left array, specified as a scalar, vector, matrix, or multidimensional
array. Numeric or string inputs A and B must
either be the same size or have sizes that are compatible (for example, A is
an M-by-N matrix and B is
a scalar or 1-by-N row vector).
For more information, see Compatible Array Sizes for Basic Operations.

If A and B are categorical,
datetime, or duration arrays, then they must be the same size unless
one is a scalar.

If one input is an ordinal categorical array, the
other input can be an ordinal categorical array, a cell array of character
vectors, or a single character vector. A single character vector expands
into a cell array of character vectors of the same size as the other
input. If both inputs are ordinal categorical arrays, they must have
the same sets of categories, including their order. See Compare Categorical Array Elements for more details.

If one input is a datetime array, the other input
can be a datetime array, a character vector, or a cell array of character
vectors.

If one input is a duration array, the other input
can be a duration array or a numeric array. The operator treats each
numeric value as a number of standard 24-hour days.

If one input is a string array, the other input can
be a string array, a character vector, or a cell array of character
vectors. The corresponding elements of A and B are
compared lexicographically.

B — Right array scalar | vector | matrix | multidimensional array

Right array, specified as a scalar, vector, matrix, or multidimensional
array. Numeric or string inputs A and B must
either be the same size or have sizes that are compatible (for example, A is
an M-by-N matrix and B is
a scalar or 1-by-N row vector).
For more information, see Compatible Array Sizes for Basic Operations.

If A and B are categorical,
datetime, or duration arrays, then they must be the same size unless
one is a scalar.

If one input is an ordinal categorical array, the
other input can be an ordinal categorical array, a cell array of character
vectors, or a single character vector. A single character vector expands
into a cell array of character vectors of the same size as the other
input. If both inputs are ordinal categorical arrays, they must have
the same sets of categories, including their order. See Compare Categorical Array Elements for more details.

If one input is a datetime array, the other input
can be a datetime array, a character vector, or a cell array of character
vectors.

If one input is a duration array, the other input
can be a duration array or a numeric array. The operator treats each
numeric value as a number of standard 24-hour days.

If one input is a string array, the other input can
be a string array, a character vector, or a cell array of character
vectors. The corresponding elements of A and B are
compared lexicographically.

This function fully supports tall arrays. For
more information, see Tall Arrays.

Tips

Some floating-point numbers cannot be represented
exactly in binary form. This leads to small differences in results
that the <= operator reflects. For more information,
see Avoiding Common Problems with Floating-Point Arithmetic.