Skip to Main Content Skip to Search
Product Documentation

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

elementwise | is* | isa | ischar | isnumeric | isreal | logical | short-circuit

  


» Learn more
» Download free kit
» Get trial software

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