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 design range information.
Open the ex_derived_min_max_5
model. At the MATLAB® command line,
enter:
addpath(fullfile(docroot,'toolbox','fixpoint','examples')) ex_derived_min_max_5
The model displays the specified design minimum and maximum values for the blocks in the model.
The Inport block In1
has a
design range of [-10..20]
.
The rest of the blocks in the model have no specified design range.
Tip
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_5
as the system you want to
convert.
Under Range Collection Mode, select Derived ranges.
Click the Collect Ranges button.
When the analysis is complete, the Fixed-Point Tool displays the derived minimum and maximum values for the blocks in the model in the spreadsheet. Because the model contains a feedback loop, the analysis is unable to derive an output range for the Add block or for any of the blocks connected to this output. The Fixed-Point Tool highlights these results.
To fix the issue, specify design minimum and maximum values inside the
feedback loop. For this example, specify the range for the
Gain2
block:
In the model, double-click the Gain2
block.
In the block parameters dialog box, select the Signal Attributes tab.
In this tab, set Output minimum to
-20
and Output maximum
to 40
and click OK.
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 uses the minimum and maximum values specified for
Gain2
and In1
to derive ranges for all
objects in the model.