Main Content

rescale

fi オブジェクトのスケーリングの変更

構文

b = rescale(a, fractionlength)

b = rescale(a, slope, bias)
b = rescale(a, slopeadjustmentfactor, fixedexponent, bias)
b = rescale(a, ..., PropertyName, PropertyValue, ...)

説明

関数 rescale には fi のコピー関数と類似の機能がありますが、以下の例外があります。

  • fi コピー コンストラクターは実際値を維持しますが、rescale は格納整数値を維持します。

  • rescaleSignedWordLength のプロパティの変更を許容しません。

次の例では、fi オブジェクト a のスケーリングを変更して、fi オブジェクト b を作成します。ab の実際値は異なりますが、それらの格納整数値は同じです。

p = fipref('FimathDisplay','none',...
		'NumericTypeDisplay','short');
a = fi(10, 1, 8, 3)
a = 

    10
      numerictype(1,8,3)
b = rescale(a,1)
b = 

    40
      numerictype(1,8,1)
stored_integer_a = storedInteger(a);
stored_integer_b = storedInteger(b);
isequal(stored_integer_a,stored_integer_b) 
ans =

  logical

   1

拡張機能

C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。

HDL コード生成
HDL Coder™ を使用して FPGA 設計および ASIC 設計のための VHDL、Verilog および SystemVerilog のコードを生成します。

バージョン履歴

R2006a より前に導入

参考