This example shows that if the analysis cannot derive range information because there is insufficient design range information, you can fix the issue by providing additional input design minimum and maximum values.
Open the ex_derived_min_max_4
model. At the MATLAB® command line,
enter:
addpath(fullfile(docroot,'toolbox','fixpoint','examples')) ex_derived_min_max_4
The model displays the specified design minimum and maximum values for the blocks in the model.
The Inport block In1
has a
design minimum but no specified maximum value, as shown by the
annotation, [-1..]
.
The Gain block has a design range of
[-1.5..1.5]
.
The Outport block Out1
has no
design range specified.
To display design ranges in your model, in the Debug tab, select Information Overlays > Signal Data Ranges.
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_4
as the system you want to
convert.
Under Range Collection Mode, select Derived ranges.
Click the Collect Ranges button.
The Fixed-Point Tool displays the derived minimum and maximum values for the
blocks in the model. The range analysis is unable to derive a maximum value for
the Inport block, In1
. The tool highlights
this result.
To fix the issue, specify a design maximum value for In1
:
In the model, double-click the Inport block,
In1
.
In the block parameters dialog box, select the Signal Attributes tab.
In this tab, set Maximum to
1
and click OK. To
update the diagram, press (Ctrl + D).
The model displays the updated maximum value in the block
annotation for In1
,
[-1..1]
.
Clear previously collected ranges and rerun the range analysis.
In the Fixed-Point Tool, under New workflow,
select Range Collection
.
Changing workflows clears range data collected during the active workflow.
Switch back to the Iterative Fixed-Point
Conversion
workflow.
Select Derived ranges as the range collection mode.
Click the Collect Ranges button again to rerun the range analysis.
The range analysis can now derive ranges for the Inport and Gain blocks.
Block | Derived Range | Reason |
---|---|---|
Inport
| [-1..1] | Uses specified design range on the block. |
Gain | [-1.5..1.5] | The design range specified on the Gain
block is |
Outport
| [-1.5..1.5] | Same as Gain block output because there is no locally specified design range on Outport block. |