Problem with non tunable parameters of embedded matlab function
24 views (last 30 days)
Show older comments
I'm using Matlab/Simulink R2011b with the 'Embedded Coder'. In my Simulink model is an embedded matlab function that runs with inputs and outputs and several parameters such as data fields. If I use 'Simulink.Parameter' as parameters for the embedded matlab function, it works fine and the option 'inline parameters' in embedded coder works properly. If I look the generated C code, I see the function prototype with the parameters that were replaced by numerical values and they are const, because I do not want to change them, so I unchecked the tunable checkbox, they shall stay untunable. All the 'Simulink.Parameters' are in my base workspace and defined for storage class as 'Auto'. This constellation works fine, no warnigs or errors at all.
I want to group my parameters in my workspace, so I create a structure with all the data fields. These fields are my parameters, but it is a normal structure. Then I create a 'Simulink.Parameter' and assign the structure to the 'Value' of a 'Simulink.Parameter'. Now, I have only one parameter for my embedded matlab function that defined as Simulink.Parameter. Everything works fine, no warnigs or errors at all. If I look into the generated C code I see that the function prototype looks different. It seems that the option 'Inline parameters' does not work in that case. The data fields are now a structure referenced by a pointer. The name of the structure is generated by Embedded Coder. I choosed the same options for 'Simulink.Parameter'. How can I resolve that problem? I want only group my parameters with the advantage of inlining. Does the option 'Inline Parameters' not work with structures? I have a workaround with a script, but it is not a good solution. Is it an issue of Embedded Coder or there is now other solution for that?
Best regards, Daniel.
0 Comments
Answers (3)
See Also
Categories
Find more on Data Types in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!