Programming |
The logical
data type represents a logical true
or false
state using the numbers 1
and 0
, respectively. Certain MATLAB functions and operators return logical true
or false
to indicate whether a certain condition was found to be true or not. For example, the statement (5
*
10)
>
40
returns a logical true
value.
Logical data does not have to be scalar; MATLAB supports arrays of logical values as well. For example, the following statement returns a vector of logicals indicating false
for the first two elements and true
for the last three:
This section covers the following topics:
Function Summary | Creating a Logical Array |
© 1994-2005 The MathWorks, Inc.