Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

islogical - Determine whether input is logical array

Syntax

tf = islogical(A)

Description

tf = islogical(A) returns logical 1 (true) if A is a logical array and logical 0 (false) otherwise.

Examples

Given the following cell array,

C{1,1} = pi;                 % double
C{1,2} = 1;                  % double
C{1,3} = ispc;               % logical
C{1,4} = magic(3)            % double array

C = 
    [3.1416]    [1]    [1]    [3x3 double]

islogical shows that only C{1,3} is a logical array.

for k = 1:4
x(k) = islogical(C{1,k});
end

x
x =
     0     0     1     0

See Also

logical, isnumeric, ischar, isreal, , logical operators (elementwise and short-circuit), isa, is*

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS