Structure arrays in Matlab2016

4 次查看(过去 30 天)
Today I faced out the problem with loading of structures in Matlab2016.
My former model was initially designed in Matlab2013 and than was converted to Matlab2014. Parameters of model were initially stored as fields of structure and than loaded to workspace and only than from workspace easily loaded to exact model. After conversion of model to Matlab2016 I faced out, that fields of structure, which is now stored to the correspondent sldd, can not be directly loaded to the model as were before, when structure was loaded to workspace. Roughly speaking, model can not detect this structure to load the parameterization data from the corresponding fields.
My questions are as follows:
  1. Is there any way, how to use structures to parameterize the model in Matlab2016?
  2. Do I need to convert structure to some entity in order to use it further? If yes, how to do it and to which entity should be the conversion provided?

回答(2 个)

Rishabh Gupta
Rishabh Gupta 2018-7-27
Hi Mykola,
Since you have stored the fields of structure as sldd, they may not be directly accessible using the dot operator as in structures.
Please refer to following links to see how to extract data from SLDD:
Also make sure the structure is on path or is accessible to the code/model.

Mykola Raievskyi
Mykola Raievskyi 2018-7-27
编辑:Mykola Raievskyi 2018-7-27
Dear Mr. Gupta,
thanks for your answer. I already resolved this issue - indexes in the model (I use them for proper data assignment and extraction) should not be declared as the fields of structure. Instead of fields of structure one has to use system constants and store all the indexes as system constants in model workspace. After that one will be able to run the simulation as well as code generation.
with best regards, Mykola Raievskyi

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by