Tunable parameters do not appear in generated S function

2 次查看(过去 30 天)
Good afternoon,
I have a problem regarding a generated S-function from a simulink subsystem. The thing is that I want to generate an S-function from a subsystem in my simulink model. To do so, I click on the subsystem with the rigth button and I choose the option "C/C++ - Generate S function". I pick the tunable parameters I want to use and I build the function.
Everything works properly and the S function files are correctly generated. The problem is, that the chosen tunable parameters do not seem to appear anywhere. Therefore I can not tun them. Has anyone any clue about the problem? Thank you in advance.
PD: my matlab version is Matlab R2013a.

回答(1 个)

Saurabh Gupta
Saurabh Gupta 2017-4-12
Although I don't know your exact use case, I am guessing that you are using some struct, enum or Simulink.Parameter type parameters. Such parameters are inlined by default because only built-in data types are supported as tunable parameters in generated S-functions. In such a case, you should see a warning in Diagnostic Viewer which would look something like
S-function parameter 'xxxx' can not be made tunable because its data type is not a built-in type
To work around it, you will need to supply individual built-in type parameters instead of combining them into composite type parameters.

类别

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

产品

Community Treasure Hunt

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

Start Hunting!

Translated by