Documentation Center

  • Trials
  • Product Updates

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:

             RoundMode: nearest
          OverflowMode: saturate
           ProductMode: FullPrecision
  MaxProductWordLength: 128
               SumMode: FullPrecision
      MaxSumWordLength: 128

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('RoundMode','Floor','OverflowMode','Wrap');
globalfimath(F);
F1 = fimath 
a = fi(pi) 

F1 =
 

             RoundMode: floor
          OverflowMode: wrap
           ProductMode: FullPrecision
  MaxProductWordLength: 128
               SumMode: FullPrecision
      MaxSumWordLength: 128
 
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 =
 

             RoundMode: nearest
          OverflowMode: saturate
           ProductMode: FullPrecision
  MaxProductWordLength: 128
               SumMode: FullPrecision
      MaxSumWordLength: 128
 
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.

See Also

| |

Was this topic helpful?