Main Content

fipref

Set fixed-point preferences

Description

P = fipref creates a default fipref object. The fipref object defines the display and logging attributes for all fi objects.

example

P = fipref(Name,Value) creates a fipref object with properties specified by Name,Value pairs.

Your fipref settings persist throughout your MATLAB® session. Use reset(fipref) to return to the default settings during your session. Use savefipref to save your display preferences for subsequent MATLAB sessions.

example

Examples

collapse all

P = fipref
P = 
         NumberDisplay: 'RealWorldValue'
    NumericTypeDisplay: 'full'
         FimathDisplay: 'full'
           LoggingMode: 'Off'
      DataTypeOverride: 'ForceOff'

You can set properties of fipref objects at the time of object creation by including properties after the arguments of the fipref constructor function. For example, to set NumberDisplay to bin and NumericTypeDisplay to short.

P = fipref('NumberDisplay','bin','NumericTypeDisplay','short')
P = 
         NumberDisplay: 'bin'
    NumericTypeDisplay: 'short'
         FimathDisplay: 'full'
           LoggingMode: 'Off'
      DataTypeOverride: 'ForceOff'

Input Arguments

collapse all

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: P = fipref('NumberDisplay','RealWorldValue','NumericTypeDisplay','short');

Data Type Override Properties

collapse all

Data type override options for fi objects, specified as the comma-separated pair consisting of 'DataTypeOverride' and one of these values:

  • 'ForceOff' — No data type override

  • 'ScaledDoubles' — Override with scaled doubles

  • 'TrueDoubles' — Override with doubles

  • 'TrueSingles' — Override with singles

Data type override only occurs when the fi constructor function is called.

Data Types: char

Data type override setting applicability to fi objects, specified as the comma-separated pair consisting of 'DataTypeOverrideAppliesTo' and one of these values:

  • 'AllNumericTypes' — Apply data type override to all fi data types. This setting does not override built-in integer types.

  • 'Fixed-Point' — Apply data type override only to fixed-point data types

  • 'Floating-Point' — Apply data type override only to floating-point fi data types

DataTypeOverrideAppliesTo displays only if DataTypeOverride is not set to ForceOff.

Data Types: char

Display Properties

collapse all

Display options for the local fimath attributes of a fi object, specified as the comma-separated pair consisting of 'FimathDisplay' and one of these values:

  • 'full' — Displays all of the fimath attributes of a fixed-point object

  • 'none' — None of the fimath attributes are displayed

Data Types: char

Display options for the values of a fi object, specified as the comma-separated pair consisting of 'NumberDisplay' and one of these values:

  • 'bin' — Displays the stored integer value in binary format

  • 'dec' — Displays the stored integer value in unsigned decimal format

  • 'RealWorldValue' — Displays the stored integer value in the format specified by the MATLAB format function

    fi objects in rat format are displayed according to

    1(2fixed-point exponent)×stored integer

  • 'hex' — Displays the stored integer value in hexadecimal format

  • 'int' — Displays the stored integer value in signed decimal format

  • 'none' — No value is displayed

The stored integer value does not change when you change the fipref object. The fipref object only affects the display.

Data Types: char

Display options for the numerictype attributes of a fi object, specified as the comma-separated pair consisting of 'NumericTypeDisplay' and one of these values:

  • 'full' — Displays all of the numerictype attributes of a fi object

  • 'none' — None of the numerictype attributes are displayed

  • 'short' — Displays the numerictype attributes of a fi object using the abbreviated notation of the numerictype constructor

Data Types: char

Logging Properties

collapse all

Logging options for operations performed on fi objects, specified as the comma-separated pair consisting of 'LoggingMode' and one of these values:

  • 'off' — No logging

  • 'on' — Information is logged for future operations

Overflows and underflows for assignment, plus, minus, and multiplication operations are logged as warnings when LoggingMode is set to on.

When LoggingMode is on, you can also use the following functions to return logged information about assignment and creation operations to the MATLAB command line:

  • maxlog — Returns the maximum real-world value

  • minlog — Returns the minimum value

  • noverflows — Returns the number of overflows

  • nunderflows — Returns the number of underflows

LoggingMode must be set to on before you perform any operation in order to log information about it. To clear the log, use the function resetlog.

Data Types: char

Version History

Introduced before R2006a

Go to top of page