TLC How to get values of structure parameters

3 views (last 30 days)
Hello!
I have created my own tlc file for code generation process. In simulink model I represented parameters as a structure. For example: params.K with dimension [10,2] [1,2,3,4,5,6,7,8,9,10;11,12,13,14,15,16,17,18,19,20] params.L with dimension [10] [1,2,3,4,5,6,7,8,9,10] params.M with dimension [10] [1,3,5,7,9]
In tlc file I need to get values for the parameters. When parameters are simple (not a structure) I can access parameters values in tlc file via next line:
%assign value = ::CompiledModel.ModelParameters.Parameter[idx].Value
But when parameters are represented as a structure this command gives me all values from params in one cell: { {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}, {1,2,3,4,5,6,7,8,9,10}, {1,3,5,7,9} }
The question is how can I get values of parameters represented as a structure in tlc file.
Thank you very much!
  1 Comment
Kaustubha Govind
Kaustubha Govind on 13 Jun 2013
Could you examine the model.rtw file (select the Retain .rtw file checkbox in the Configuration Parameters window), and paste what the record corresponding to your parameter looks like. Is there any knowledge about the structure fields maintained?

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!