quantize
構文
説明
は、quantizedinterval
= quantize(interval
, numerictype
)numerictype
で指定された数値型に量子化された、fixed.Interval
オブジェクトの量子化された範囲 interval
を返します。
は、名前と値のペアとして指定された追加のプロパティで、quantizedinterval
= quantize(interval
, numerictype
, Name,Value
)fixed.Interval
オブジェクトの量子化された範囲 interval
を返します。
例
数値区間の uint8 への量子化
fixed.Interval
オブジェクトを作成し、符号なしの 8 ビット整数に量子化された Interval
オブジェクトの範囲を検出します。
interval = fixed.Interval(-200,200);
quantizedInterval = quantize(interval, 'fixdt(0,8,0)')
quantizedInterval = 1×2 uint8 row vector 0 200
fixdt(0,8,0)
は uint8
と同等なので、関数 quantize
は数値型の表現可能な範囲内の端点を使用して uint8
行ベクトルとして量子化された範囲を返します。
量子化された行ベクトルを固定小数点データ型として返すには、'PreferBuiltIn'
プロパティを false
に設定します。
quantizedInterval = quantize(interval, 'fixdt(0,8,0)',... 'PreferBuiltIn', false)
quantizedInterval = 0 200 DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 8 FractionLength: 0
入力引数
interval
— 量子化する入力 fixed.Interval
オブジェクト
fixed.Interval
オブジェクト | fixed.Interval
オブジェクトの配列
入力 fixed.Interval
オブジェクト。fixed.Interval
オブジェクト、または fixed.Interval
オブジェクトの配列として指定します。
numerictype
— 数値データ型
Simulink.Numerictype
オブジェクト | embedded.numerictype
オブジェクト | 文字ベクトル
Interval
を量子化する数値データ型。Simulink.Numerictype
オブジェクト、embedded.numerictype
オブジェクト、または 'single'
などの数値データ型を表す文字ベクトルとして指定します。
例: quantizedinterval = quantize(interval, 'fixdt(1,16,8)');
名前と値の引数
引数のオプションのペアを Name1=Value1,...,NameN=ValueN
として指定します。Name
は引数名、Value
は対応する値です。名前と値の引数は他の引数の後に表示されなければなりませんが、ペアの順序は重要ではありません。
R2021a より前は、名前と値をそれぞれコンマを使って区切り、Name
を引用符で囲みます。
例: interval = quantize(interval, 'fixdt(1,16,0)', 'PreferBuiltIn', false, 'PreferStrict', true);
PreferBuiltIn
— 可能な場合の組み込みデータ型への量子化
true (既定値) | false
このプロパティが true のとき、指定された numerictype
に同等の組み込み整数型がある場合、組み込み型が返されます。たとえば、このプロパティが true
の場合、'fixdt(1,8,0)'
の指定された numerictype
は int8
を返します。
データ型: logical
PreferStrict
— 端点の数値型への量子化
false (既定値) | true
このプロパティが true の場合、区間が閉じているか開いているかに関係なくすべての端点は元の区間内で最も近い表現可能な値に量子化されます。
データ型: logical
出力引数
quantizedinterval
— 区間範囲の量子化
N 行 2 列の行列
numerictype
で指定された数値データ型に量子化される入力 Interval
オブジェクトの端点で構成される行をもつ N 行 2 列の行列。
'PreferStrict'
プロパティが false
に設定される場合、量子化後の端点は元の区間外に置かれる可能性があります。
バージョン履歴
R2019b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)