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
は格納整数値を維持します。rescale
はSigned
とWordLength
のプロパティの変更を許容しません。
例
次の例では、fi
オブジェクト a
のスケーリングを変更して、fi
オブジェクト b
を作成します。a
と b
の実際値は異なりますが、それらの格納整数値は同じです。
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
拡張機能
バージョン履歴
R2006a より前に導入