How to use derived ranges for gain and constant blocks using derive range analysis?

1 回表示 (過去 30 日間)
I am trying to use derived range analysis and I am specifying design min, max for the gain block parameter as shown in the model below. But derived range analysis treats the parameter as a constant and disregards the design min, max. I would expect the derived ranges for the output of the gain block to be [0 (0x1), 960 (15x64)] while I see a range of [0,30].

採用された回答

MathWorks Fixed Point Team
MathWorks Fixed Point Team 2020 年 1 月 3 日
In this scenario, your parameter is not considered as tunable and therefore treated as an invariant constant. So the design ranges do not apply and we take the actual value into consideration. You need to specify and use a tunable parameter in order to leverage the design ranges during range analysis.
You can do this using Simulink.Parameter object, specify the design min, max for the parameter value. In order to make the parameter tunable, you need to set the storage class to a value other than the default “Auto” setting.
Here is one way to specify the parameter with ‘Model Default’ as the storage class:
myGain = Simulink.Parameter(2);
myGain.Min = 1;
myGain.Max = 64;
myGain.StorageClass = 'Model Default';
Please use the attached example to follow the suggestions above.
Please refer to the doc link for more information on derive range analysis with Simulink parameter objects.

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by