I'm trying to generate code (using S-function target TLC) for a subsystem with several components accepting parameters, which are fields of a Matlab variable of type structure. I would like the structure parameter fields be tunable in the generated code. - Non-tunable rate transition, ZOH, etc. blocks' parameters are not fields of this structure. - Tunable parameter syntax restrictions in Constant source blocks (such as avoiding [,] and structure referencing) are followed. - A Simulink.Parameter object with value struct is defined in the Base Workspace. - When building the subsystem, this parameter is checked to be "tunable".
However, During the build process Matlab returns a warning in the command window telling me that the the parameter X, which is my structure parameter, is not a built-in type therefore cannot be tunable. Apart from this issue the build process turns out to be OK.
Any ideas what may have gone wrong?
Thanks in advance, Sinan Pakkan
I think problem is due to you are using multi-level (a few fields of the structure are themselves structures) structure.
See the structure parameter limitations here.
Try using a structure which contains numerical values in all the fields.
MyStruct.Value1 = 100; MyStruct.Value2 = 200; MyStruct.Value3 = 500;
MyParam = Simulink.Parameter; MyParam.Value = MyStruct;
I can't test this feature because I am far behind in the race and using R2007a. :-(