Main Content

isboolean

入力が boolean かどうかを判別

説明

tf = isboolean(a)fi オブジェクト aDataType プロパティが Boolean である場合に 1 (true) を返します。それ以外の場合は 0 (false) を返します。

tf = isboolean(T)numerictype オブジェクト TDataType プロパティが Boolean である場合に 1 (true) を返します。それ以外の場合は 0 (false) を返します。

すべて折りたたむ

fi オブジェクトを作成し、そのデータ型が 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

numerictype オブジェクトを作成し、そのデータ型が 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

入力引数

すべて折りたたむ

入力 fi オブジェクト。スカラー、ベクトル、行列または多次元配列として指定します。

データ型: fi

入力 numerictype オブジェクト。スカラーとして指定します。

バージョン履歴

R2008a で導入