fipref を使用した fi オブジェクトの表示基本設定
fipref オブジェクトを使用して fi オブジェクトの表示に関する 3 つの要素、つまり、オブジェクトの値、ローカル fimath プロパティおよび numerictype プロパティを指定します。
たとえば、次のコードは、ローカル fimath オブジェクトをもつ fi オブジェクトの既定の fipref 表示を示します。
a = fi(pi,'RoundingMethod','Floor','OverflowAction','Wrap')
a =
3.1415
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 13
RoundingMethod: Floor
OverflowAction: Wrap
ProductMode: FullPrecision
SumMode: FullPrecision
ローカル fimath のない fi オブジェクトの場合、fipref の既定の表示は次のようになります。
a = fi(pi)
a =
3.1416
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 13
次に、fipref 表示プロパティを変更します。
P = fipref; P.NumberDisplay = 'bin'; P.NumericTypeDisplay = 'short'; P.FimathDisplay = 'none'
P =
NumberDisplay: 'bin'
NumericTypeDisplay: 'short'
FimathDisplay: 'none'
LoggingMode: 'Off'
DataTypeOverride: 'ForceOff'
a
a =
0110010010001000
numerictype(1,16,13)