Main Content

isboolean

Determine whether input is Boolean

Description

example

tf = isboolean(a) returns 1 (true) when the DataType property of fi object a is Boolean. Otherwise, it returns 0 (false).

example

tf = isboolean(T) returns 1 (true) when the DataType property of numerictype object T is Boolean. Otherwise, it returns 0 (false).

Examples

collapse all

Create a fi object and determine if its data type is Boolean.

a = fi(pi)
a = 
    3.1416

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 13
tf = isboolean(a)
tf = logical
   0

a = fi(pi,'DataType','Boolean')
a = 
   1

          DataTypeMode: Boolean
tf = isboolean(a)
tf = logical
   1

Create a numerictype object and determine if its data type is Boolean.

T = numerictype
T =


          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 15
tf = isboolean(T)
tf = logical
   0

T = numerictype('Boolean')
T =


          DataTypeMode: Boolean
tf = isboolean(T)
tf = logical
   1

Input Arguments

collapse all

Input fi object, specified as a scalar, vector, matrix, or multidimensional array.

Data Types: fi

Input numerictype object, specified as a scalar.

Version History

Introduced in R2008a