Skip to content

islogical

Test whether the input is of logical (boolean) type.

tf = islogical(A)

Returns true when A’s element type is the boolean / logical type, false otherwise. Applied elementwise for non-scalar inputs in script mode; scalar in Excel-compatible mode.

islogical(true) % 1
islogical(1) % 0
islogical([true false true]) % 1 1 1
  • isnumeric — Test whether the input is a numeric type.
  • isinteger — Test whether the input is integer-typed (or, in script mode, integer-valued).