logical data type represents
using the numbers
Certain MATLAB® functions and operators return logical values
to indicate fulfillment of a condition. You can use those logical
values to index into an array or execute conditional code. For more
information, see how to Find Array Elements That Meet a Condition.
|Logical operations with short-circuiting|
|Find logical AND|
|Find logical NOT|
|Find logical OR|
|Find logical exclusive-OR|
This example shows how to filter the elements of an array by applying conditions to the array.
This example shows how to use the
all functions to reduce an entire array to a single logical value.
Precedence rules determine the order in which MATLAB evaluates an expression.
This reference table shows the results of applying
the binary logical operators to a series of logical
Determine whether an array is logical by testing the entire array or each element individually.