Main Content

resetglobalfimath

集全球fimathMATLABfactory default

Syntax

resetglobalfimath

Description

resetglobalfimathsets 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

Examples

In this example, you create your ownfimathobjectFand set it as the global fimath. Then, using theresetglobalfimathcommand, 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 theremoveglobalfimathprefcommand.

Alternatives

reset(G)— IfGis a handle to the global fimath,reset(G)is equivalent to using theresetglobalfimathcommand.

Introduced in R2010a