resetglobalfimath

Set global fimath to MATLAB factory default

Syntax

resetglobalfimath

Description

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

Examples

In this example, you create your own fimath object F and set it as the global fimath. Then, using the resetglobalfimath 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 using resetglobalfimath:

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 the removeglobalfimathpref command.

Alternatives

reset(G) — If G is a handle to the global fimath, reset(G) is equivalent to using the resetglobalfimath command.

Was this topic helpful?