How do I generate grt code with a global parameter in the Index of the Selector

1 Ansicht (letzte 30 Tage)
Hi,
I would like to generate the grt.tlc code for a model that inludes Selector. The index of the Selector is defined using a variable/parameter, which is desirably to be included in the Global parameter -> Setting/Optimization/Signal and Parameter/Configure. I am receive a error message if I am trying to generate the code with this variable defined in the Global parameter. I don't need it to be tunable during runtime, but need it for initialization. How should I setup the congifuration? An example is attached.
### Starting build procedure for model: untitled_v4_nontunablePara
Code Generation 1
Elapsed: 0.360 sec
### Build procedure for model: 'untitled_v4_nontunablePara' aborted due to an error.
For dimensions 1: invalid setting in 'untitled_v4_nontunablePara/Selector3' for parameter 'Indices'.

Antworten (1)

Shiva Kalyan Diwakaruni
Shiva Kalyan Diwakaruni am 17 Dez. 2020
Hi ,
To initialize variable first you can -
1)open the model explorer
2)Go to Model Workspace
3)choose matlab code from data source drop down
4)type nb_Cap=30;
5)give nb_Cap as argument in Model Arguments text box.
6)click apply
7)generate code
hope it helps,
thanks
  1 Kommentar
And Meng
And Meng am 17 Dez. 2020
Thank you Shiva for your answer. I think I did not make it clear. I need a blackbox where the value of nb_Cap should be specified at the mask of the blackbox. The method you have mentioned would make nb_Cap to a fixed value and can no longer be changed.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Produkte


Version

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by