Set fixed-point preferences
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.
fipref
ObjectP = fipref
P = NumberDisplay: 'RealWorldValue' NumericTypeDisplay: 'full' FimathDisplay: 'full' LoggingMode: 'Off' DataTypeOverride: 'ForceOff'
fipref
Properties at Object CreationYou 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'
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
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 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
'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 the fimath
attributes of a fixed-point object
'none'
— None of the fimath
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 MATLAB
format
function
fi
objects in rat
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 the
numerictype
attributes of a fixed-point object
'none'
— None of the numerictype
attributes are displayed
'short'
— Displays an abbreviated notation of the
fixed-point data type and scaling of a fixed-point object in the format
xWL,FL
where
x
is s
for signed and
u
for unsigned
WL
is the word length
FL
is the fraction length
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 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
fi
| fimath
| numerictype
| quantizer
| savefipref
You have a modified version of this example. Do you want to open this example with your edits?