Documentation Center

  • Trial Software
  • Product Updates

fi Object Display Preferences Using fipref

You use the fipref object to specify three aspects of the display of fi objects: the object value, the local fimath properties, and the numerictype properties.

For example, the following code shows the default fipref display for a fi object with a local fimath object:

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

The default fipref display for a fi object with no local fimath is as follows:

a = fi(pi)
 
a =
 
    3.1416


          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 13

Next, change the fipref display properties:

P = fipref;
P.NumberDisplay = 'bin';
P.NumericTypeDisplay = 'short';
P.FimathDisplay = 'none'
 
P =
         NumberDisplay: 'bin'
    NumericTypeDisplay: 'short'
         FimathDisplay: 'none'
           LoggingMode: 'Off'
      DataTypeOverride: 'ForceOff'
a
 
a =
0110010010000111
      s16,13

For more information on the default fipref display, see View Fixed-Point Data.

Was this topic helpful?