集全球fimathMATLABfactory default
resetglobalfimath
resetglobalfimath
sets the global fimath to the MATLAB®factory default in your current MATLAB session. The MATLAB factory default has the following properties:
RoundingMethod: Nearest OverflowAction: Saturate ProductMode: FullPrecision SumMode: FullPrecision
In this example, you create your ownfimath
objectF
and set it as the global fimath. Then, using theresetglobalfimath
command, reset the global fimath to the MATLAB factory default setting.
F = fimath('RoundingMethod','Floor','OverflowAction','Wrap'); globalfimath(F); F1 = fimath a = fi(pi) F1 = RoundingMethod: Floor OverflowAction: Wrap ProductMode: FullPrecision SumMode: FullPrecision a = 3.1416 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13
Now, set the global fimath back to the factory default setting usingresetglobalfimath
:
resetglobalfimath; F2 = fimath a = fi(pi) F2 = RoundingMethod: Nearest OverflowAction: Saturate ProductMode: FullPrecision SumMode: FullPrecision a = 3.1416 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13
You've now set the global fimath in your current MATLAB session back to the factory default setting. To use the factory default setting of the global fimath in future MATLAB sessions, you must use theremoveglobalfimathpref
command.
reset(
— IfG
)G
is a handle to the global fimath,reset(
is equivalent to using theG
)resetglobalfimath
command.