Skip to Main Content Skip to Search
Product Documentation

Using fipref Objects to Set Display Preferences

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, 'RoundMode', 'floor', 'OverflowMode', 'wrap')

a =
    3.1415

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

             RoundMode: floor
          OverflowMode: wrap
           ProductMode: FullPrecision
  MaxProductWordLength: 128
               SumMode: FullPrecision
      MaxSumWordLength: 128

The default fipref display for a fi object associated with the global 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 Display Settings in the Getting Started section of the Fixed-Point Toolbox User's Guide.

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS