Simulink.Parameter
ObjectsThis example shows how the range analysis takes into account design range information
for Simulink.Parameter
objects unless the
parameter storage class is set to Auto
. If the parameter storage
class is set to Auto
, the analysis uses the value of the
parameter.
Open the ex_derived_min_max_3
model. At the MATLAB® command line,
enter:
addpath(fullfile(docroot,'toolbox','fixpoint','examples')) ex_derived_min_max_3
The model displays the specified design minimum and maximum values for the
Inport blocks. The design range for both
Inport blocks is [1..2]
.
Tip
To display design ranges in your model, in the Debug tab, select Information Overlays > Signal Data Ranges.
Examine the gain parameters for the Gain blocks.
Double-click each Gain block and note the name of the Gain parameter on the Main tab.
Gain Block | Gain Parameter |
---|---|
Gain1 | paramObjOne |
Gain2 | paramObjTwo |
In the Modeling tab, expand the Design gallery and select Model Explorer.
In Model Explorer window, select the base workspace and view information for each of the gain parameters used in the model.
Gain Parameter | Type Information | Value | Storage Class |
---|---|---|---|
paramObjOne |
| 2 | Auto |
paramObjTwo |
| 2 | Model default |
From the Simulink® Apps tab, select Fixed-Point Tool.
In the Fixed-Point Tool, under New workflow, select
Iterative Fixed-Point Conversion
.
In the Fixed-Point Tool, under System Under Design (SUD),
select ex_derived_min_max_3
as the system you want to
convert.
Under Range Collection Mode, select Derived ranges.
Click the Collect Ranges button.
When the analysis is finished, the Fixed-Point Tool displays the derived minimum and maximum values for the blocks in the model in the spreadsheet.
Block | Derived Range | Reason |
---|---|---|
Gain1 | [2..4] | The gain parameter, |
Gain2 | [1..20] | The gain parameter, |