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

1 次查看(过去 30 天)
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'.

回答(1 个)

Shiva Kalyan Diwakaruni
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 个评论
And Meng
And Meng 2020-12-17
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

产品


版本

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by