Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

fixdt

固定小数点または浮動小数点データ型を記述した Simulink.NumericType オブジェクトの作成

説明

a = fixdt(Signed,WordLength) は、指定された符号属性と語長をもち、スケーリングか未指定の固定小数点データ型を記述する Simulink.NumericType オブジェクトを返します。

a = fixdt(Signed,WordLength,FractionLength) は、2 進小数点スケーリングが行われる固定小数点データ型を記述する Simulink.NumericType オブジェクトを返します。

a = fixdt(Signed,WordLength,TotalSlope,Bias) は、勾配とバイアス スケーリングが行われる固定小数点データ型を記述する Simulink.NumericType オブジェクトを返します。

a = fixdt(Signed,WordLength,SlopeAdjustmentFactor,FixedExponent,Bias) は、勾配とバイアス スケーリングが行われる固定小数点データ型を記述する Simulink.NumericType オブジェクトを返します。

a = fixdt(DataTypeNameString) は、データ型の名前で指定される整数データ型、固定小数点データ型、または浮動小数点データ型を記述する Simulink.NumericType オブジェクトを返します。

a = fixdt(___,'DataTypeOverride','Off') は、DataTypeOverride パラメーターが Off に設定された Simulink.NumericType オブジェクトを返します。このプロパティの既定値は Inherit です。DataTypeOverride パラメーターは、他の入力パラメーターの任意の組み合わせの後に指定できます。

[a,IsScaledDouble] = fixdt(___) は、固定小数点データ型または浮動小数点データ型と、指定されるデータ型がスケーリングされた double データ型かどうかを示すフラグを記述する Simulink.NumericType オブジェクトを返します。

すべて折りたたむ

16 ビットの語長でスケーリングが未指定の符号付き Simulink.NumericType オブジェクトを作成します。

a = fixdt(1,16)
a = 
  NumericType with properties:

    DataTypeMode: 'Fixed-point: unspecified scaling'
      Signedness: 'Signed'
      WordLength: 16
         IsAlias: 0
       DataScope: 'Auto'
      HeaderFile: ''
     Description: ''

語長が 16 ビットで小数部の長さが 2 ビットの符号付き固定小数点データ型を記述する Simulink.NumericType オブジェクトを作成します。

a = fixdt(1,16,2)
a = 
  NumericType with properties:

      DataTypeMode: 'Fixed-point: binary point scaling'
        Signedness: 'Signed'
        WordLength: 16
    FractionLength: 2
           IsAlias: 0
         DataScope: 'Auto'
        HeaderFile: ''
       Description: ''

勾配バイアスのスケーリングされた数値の実際値は以下で表されます。

realworldvalue=(slope×integer)+bias

語長が 16 ビット、勾配が 2^-2、バイアスが 4 の符号付き固定小数点データ型を記述する Simulink.NumericType オブジェクトを作成します。

a = fixdt(1,16,2^-2,4)
a = 
  NumericType with properties:

    DataTypeMode: 'Fixed-point: slope and bias scaling'
      Signedness: 'Signed'
      WordLength: 16
           Slope: 0.2500
            Bias: 4
         IsAlias: 0
       DataScope: 'Auto'
      HeaderFile: ''
     Description: ''

あるいは、勾配は次のように表すことができます。

slope=slopeadjustmentfactor×2fixedexponent

a = fixdt(1,16,1,-2,4)
a = 
  NumericType with properties:

    DataTypeMode: 'Fixed-point: slope and bias scaling'
      Signedness: 'Signed'
      WordLength: 16
           Slope: 0.2500
            Bias: 4
         IsAlias: 0
       DataScope: 'Auto'
      HeaderFile: ''
     Description: ''

Simulink.NumericType オブジェクト aDataTypeMode プロパティは、slope and bias scaling です。

データ型名を使用して、8 ビット符号なし固定小数点データ型を記述する Simulink.NumericType オブジェクトを作成し、オブジェクトがスケーリングされた double データ型であるかどうかを示すフラグを返します。

[a,IsScaledDouble] = fixdt('ufix8')
a = 
  NumericType with properties:

      DataTypeMode: 'Fixed-point: binary point scaling'
        Signedness: 'Unsigned'
        WordLength: 8
    FractionLength: 0
           IsAlias: 0
         DataScope: 'Auto'
        HeaderFile: ''
       Description: ''

IsScaledDouble = logical
   0

IsScaledDouble の出力は 0 を返します。これは、a のデータ型がスケーリングされた double データ型ではないことを示しています。

DataTypeOverride プロパティが Off に設定された Simulink.NumericType オブジェクトを作成します。

a = fixdt(0,8,2,'DataTypeOverride','Off')
a = 
  NumericType with properties:

        DataTypeMode: 'Fixed-point: binary point scaling'
          Signedness: 'Unsigned'
          WordLength: 8
      FractionLength: 2
    DataTypeOverride: 'Off'
             IsAlias: 0
           DataScope: 'Auto'
          HeaderFile: ''
         Description: ''

入力引数

すべて折りたたむ

Simulink.NumericType オブジェクトの符号属性。数値または logical 1 (true) または 0 (false) として指定します。1 または true の値は符号付きデータ型を示します。0 または false の値は、符号なしデータ型を示します。

データ型: logical

Simulink.NumericType オブジェクトの語長 (ビット単位)。正のスカラーとして指定します。

データ型: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Simulink.NumericType オブジェクトの小数部の長さ (ビット単位)。スカラーとして指定します。

FractionLengthWordLength より大きくなってもかまいません。詳細については、2 進小数点の解釈 (Fixed-Point Designer)を参照してください。

データ型: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

スケーリングの勾配。スカラーとして指定します。

次の方程式は、勾配バイアスのスケーリングされた数値の実際値を表します。

real world value = (slope×integer)+bias

データ型: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

スケーリングのバイアス。スカラーとして指定します。

次の方程式は、勾配バイアスのスケーリングされた数値の実際値を表します。

real world value = (slope×integer)+bias

データ型: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

勾配バイアスのスケーリングされた数値の勾配調整係数。正のスカラーとして指定します。

勾配調整係数は 1 以上かつ 2 未満でなければなりません。この範囲外の SlopeAdjustmentFactor を入力すると、fixdt は自動的に SlopeAdjustmentFactor および FixedExponent の値にスケーリングの正規化を適用して、修正後の勾配調整係数が 1 以上かつ 2 未満になるようにし、勾配の値を維持します。

次の方程式は、勾配、固定小数点の指数、勾配調整係数の間の関係を示します。

slope=slope adjustment factor×2fixed exponent

データ型: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

勾配バイアスのスケーリングされた数値の固定小数点の指数。スカラーとして指定します。

次の方程式は、勾配、固定小数点の指数、勾配調整係数の間の関係を示します。

slope=slope adjustment factor×2fixed exponent

データ型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

データ型名。文字ベクトルとして指定します。

データ型名は、Simulink® の組み込みデータ型名または Fixed-Point Designer™ 製品で規定されている固定小数点の命名法に適合する固定小数点データ型名のいずれかになります。詳細については、固定小数点データ型とスケーリングの表記法 (Fixed-Point Designer)を参照してください。

データ型: char

出力引数

すべて折りたたむ

データ型。Simulink.NumericType オブジェクトとして返されます。

スケーリングされた double フラグ。指定されたデータ型名がスケーリングされた double データ型の名前であるかどうかを示す logical として返されます。

バージョン履歴

R2006a より前に導入

参考