removefimath
fimath
を fi
オブジェクトから削除する
説明
例
この例では、fi
オブジェクトおよび fimath オブジェクトの定義方法、fi
オブジェクトへの fimath
オブジェクトの付加方法および付加された fimath
オブジェクトの削除方法を説明します。
a = fi(pi)
a = 3.1416 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13
f = fimath('RoundingMethod','Floor','OverflowAction','Wrap'); a = setfimath(a,f)
a = 3.1416 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13 RoundingMethod: Floor OverflowAction: Wrap ProductMode: FullPrecision SumMode: FullPrecision
b = removefimath(a)
b = 3.1416 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13
この例では、パターン X = setfimath(X,F)
と Y = removefimath(Y)
を使用して、変数の fimath
設定が関数の外部から影響を受けないようにする方法を示します。このパターンは生成コードでデータのコピーを作成しません。
type fixed_point_32bit_KeepLSB_plus_example.m
function y = fixed_point_32bit_KeepLSB_plus_example(a,b) f = fimath('RoundingMethod', 'Floor', ... 'OverflowAction', 'Wrap', ... 'SumMode', 'KeepLSB', ... 'SumWordLength', 32) a = setfimath(a,f); b = setfimath(b,f); y = a + b; y = removefimath(y); end
a = fi(0,1,16,15); b = fi(0,1,16,15);
MATLAB® Coder™ を使用して C コードを生成できます。この例では、32 ビットのネイティブ整数型をもつコンピューターで C コードを生成します。
codegen -config:lib fixed_point_32bit_KeepLSB_plus_example... -args {a,b} -launchreport Code generation successful: View report
コード生成レポートでコードをトレースします。
入力引数
データ型と値を出力にコピーする元の入力データ。スカラー、ベクトル、行列または多次元配列として指定します。入力 x
が fi
オブジェクトでない場合、y = x
となります。
データ型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fi
複素数のサポート: あり
出力引数
拡張機能
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
バージョン履歴
R2012b で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)