reset
Clear stored information from NumericTypeScope
object
Syntax
Description
Examples
Use the NumericTypeScope to view the dynamic range of a fi object.
Create a fi object and set the DataTypeOverride to ScaledDoubles.
a = fi(magic(10),1,8,2);
b = fi([a; 2.^(-5:4)],1,8,3);
fp = fipref;
initialDTOSetting = fp.DataTypeOverride;
fp.DataTypeOverride = 'ScaledDoubles';
Create a NumericTypeScope object. You can use the reset method to ensure that all stored information is cleared from the NumericTypeScope object h.
h = NumericTypeScope; reset(h)
Use the step method to process your data and visualize the dynamic range of the fi object b.
step(h,b);

Closing the NumericTypeScope window does not delete the object from your workspace. Close the NumericTypeScope window and reopen it using the show function.
show(h);
The NumericTypeScope displays a log2 histogram which shows that the values appear both outside of the range and below the precision of the data type of the variable. Pause on one bar of the histogram to view the percentage of the total values that are represented by that bar.

In this case, the data type of b is numerictype(1,8,3). The numerictype(1,8,3) data type provides 5 integer bits, including the signed bit, and 3 fractional bits. Thus, this data type can represent only values between -2^4 and 2^4 - 2^-3 (from -16 to 15.8750). Given the range and precision of this data type, values greater than 2^4 fall outside the range and values less than 2^-3 fall below the precision of the data type.
The NumericTypeScope shows that values requiring bits 5, 6, and 7 are outside the range and values requiring fractional bits 4 and 5 are below precision. Given this information, you can prevent values that are outside range and below precision by changing the data type of the variable b to numerictype(0,13,5).
Given this information, you can prevent values that are outside range and below precision by changing the data type of the variable b to numerictype(0,13,5). In the NumericTypeScope, enter numerictype(0,13,5) in the Proposed Data Type box.

Return to the original data type override setting.
fp.DataTypeOverride = initialDTOSetting;
Input Arguments
NumericTypeScope object, specified as a
NumericTypeScope object.
Example: reset(H)
Version History
Introduced in R2010a
See Also
NumericTypeScope | step | show
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)