Parameter Quantization Advisor
Inspect numerical issues related to parameter quantization
The Parameter Quantization Advisor app provides details on numerical issues related to parameter quantization. Using this app, you can:
Filter quantization issues resulting from parameter overflow, underflow, and precision loss.
Sort quantization issues based on bits of error, absolute error, or relative error.
Explore in detail the effects of parameter quantization on your model.
Explore all parameters associated with a model.
Open the Parameter Quantization Advisor App
Diagnostic Viewer: From a numeric diagnostic warning or error, under Suggested Actions, click Open.
Explore Parameter Precision Loss
Use the Parameter Quantization Advisor to explore parameter precision loss in a feedback controller model.
Check that parameter diagnostics are enabled. In the Configuration Parameters dialog, under Diagnostics > Data Validity, set the Detect precision loss parameter diagnostic to
Simulate the model.
The Diagnostic Viewer displays a warning for parameter precision loss.
To inspect details of this diagnostic in the Parameter Quantization Advisor, from Suggested Actions, click Open.
The app displays details of the parameter precision loss that occurred in
fxpdemo_feedback/Denominator Terms. In this example, the model has only precision loss issues, as indicated by a blue square in the Quantization Issue column of the table. You can also use the app to explore overflow and underflow issues.
Four coefficients in the Discrete FIR Filter block named
Denominator Terms experienced precision loss. The table shows the dialog value entered for each parameter and the corresponding quantized value of each parameter. You can sort the table by bits of error, absolute error, or relative error.
The Parameter Details pane contains additional details for the parameter experiencing numeric issues, including the location in the model and the name, dimension, and complexity of the parameter. The table displays the data type of the parameter in the dialog and the data type of the parameter at run time along with the minimum, maximum, and precision representable by these data types.
Update the diagram or simulate the model to view messages in the Diagnostic Viewer.
The model must successfully compile in order to launch the Parameter Quantization Advisor app. If a diagnostic errors, the model will not compile and the app cannot be launched.
The Parameter Quantization Advisor app reports information for these quantization issues:
Diagnostics set to
noneare also reported in the app.
The Parameter Quantization Advisor reports details on quantization issues for tunable and nontunable parameters that experience quantization loss.
You can inspect all parameters associated with a model in the Parameter Quantization Advisor. A hierarchical tree of all parameters in the model is displayed in the Parameter Explorer. Select the parameter you would like to inspect to view additional details.
Version HistoryIntroduced in R2022b
R2023a: View Multiple Parameters
The Parameter Quantization Advisor now allows you to explore all parameters associated with a model.
Additionally, the Parameter Quantization Advisor has expanded support for the MATLAB Function block, Stateflow® chart parameters, the FIR Decimation (DSP System Toolbox) block, and the FIR Interpolation (DSP System Toolbox) block.