unitquantize
eps
が +1
以内の数値を除く quantizer
オブジェクトを使用した数値データの量子化
説明
例
固定小数点型に量子化
unitquantize
で quantizer
オブジェクトを使用してデータを量子化します。
x = (0.8:.1:1.2)'; q = quantizer('fixed','floor','saturate',[4 3]); y = unitquantize(q,x); z = [x y] e = eps(q)
z = 0.8000 0.7500 0.9000 1.0000 1.0000 1.0000 1.1000 1.0000 1.2000 1.0000 e = 0.1250
unitquantize
は、eps
が +1
以内の数値を除いて x
の要素を量子化します。
quantize
と unitquantize
の動作の比較
x = [1 pi/4]; q = quantizer([8,7]) y1 = quantize(q,x) y2 = unitquantize(q,x)
q = DataMode = fixed RoundMode = floor OverflowMode = saturate Format = [8 7] Warning: 1 overflow(s) occurred in the fi quantize operation. y1 = 0.9922 0.7812 y2 = 1.0000 0.7812
入力引数
q
— データ型プロパティ
quantizer
オブジェクト
量子化に使用するデータ型プロパティ。quantizer
オブジェクトとして指定します。
例: q = quantizer('fixed','ceil','saturate',[5 4]);
x
— 量子化するデータ
スカラー | ベクトル | 行列 | 多次元配列 | cell 配列 | 構造体
量子化するデータ。スカラー、ベクトル、行列、多次元配列、cell 配列、または構造体として指定します。
x
が数値配列の場合、x
の各要素が量子化されます。x
が cell 配列の場合、cell 配列の各数値要素が量子化されます。x
が構造体の場合、x
の各数値フィールドが量子化されます。
unitquantize
では、x
の数値以外の要素やフィールドは変更されず、数値以外の値に対する警告も発行されません。eps
(q)
が +1
以内の数値は +1
と厳密に等しくなります。
データ型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| struct
| cell
複素数のサポート: あり
x1,x2,…
— 量子化するデータ (個別の要素)
スカラー | ベクトル | 行列 | 多次元配列 | cell 配列 | 構造体
量子化するデータ (個別の要素)。スカラー、ベクトル、行列、多次元配列、cell 配列、または構造体として指定します。
データ型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| struct
| cell
複素数のサポート: あり
バージョン履歴
R2008a で導入
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)