Main Content

islogical

Determine if input is logical array

Syntax

tf = islogical(A)

Description

tf = islogical(A)returnstrueifAis a logical array andfalseotherwise.islogicalalso returnstrueifAis an instance of a class that is derived from thelogicalclass.

Examples

These examples show the valuesislogicalreturns when passed specific types:

% Relational operators return logical valuesislogical(5<7) ans = 1% true and false return logical valuesislogical(true) & islogical(false) ans = 1% Constants are double-precision by defaultislogical(1) ans = 0% logical creates logical valuesislogical(logical(1)) ans = 1

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

See Also

||

Introduced before R2006a