fipref
Set fixed-point preferences
Description
creates a default
P
= fipreffipref
object. The fipref
object defines the display and
logging attributes for all fi
objects.
creates a P
= fipref(Name,Value
)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.
Examples
Create a Default fipref
Object
P = fipref
P = NumberDisplay: 'RealWorldValue' NumericTypeDisplay: 'full' FimathDisplay: 'full' LoggingMode: 'Off' DataTypeOverride: 'ForceOff'
Set fipref
Properties at Object Creation
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
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');
DataTypeOverride
— Data type override options
'ForceOff'
(default) | 'ScaledDoubles'
| 'TrueDoubles'
| 'TrueSingles'
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
DataTypeOverrideAppliesTo
— Data type override setting applicability
'AllNumericTypes'
(default) | 'Fixed-Point'
| 'Floating-Point'
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 allfi
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-pointfi
data types
DataTypeOverrideAppliesTo
displays only if
DataTypeOverride
is not set to
ForceOff
.
Data Types: char
FimathDisplay
— Display options for local fimath
attributes of fi
objects
'full'
(default) | 'none'
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 thefimath
attributes of a fixed-point object'none'
— None of thefimath
attributes are displayed
Data Types: char
NumberDisplay
— Display options for the value of a fi
object
'RealWorldValue'
(default) | 'bin'
| 'dec'
| 'hex'
| 'int'
| 'none'
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 MATLABformat
functionfi
objects inrat
format are displayed according to'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
NumericTypeDisplay
— Display options for the numerictype
attributes of a fi
object
'full'
(default) | 'none'
| 'short'
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 thenumerictype
attributes of afi
object'none'
— None of thenumerictype
attributes are displayed'short'
— Displays thenumerictype
attributes of afi
object using the abbreviated notation of thenumerictype
constructor
Data Types: char
LoggingMode
— Logging options for operations performed on fi
objects
'off'
(default) | 'on'
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 valueminlog
— Returns the minimum valuenoverflows
— Returns the number of overflowsnunderflows
— 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
See Also
fi
| fimath
| numerictype
| quantizer
| savefipref
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)