Azzera filtri
Azzera filtri

Structure arrays in Matlab2016

4 visualizzazioni (ultimi 30 giorni)
Mykola Raievskyi
Mykola Raievskyi il 17 Lug 2018
Modificato: Mykola Raievskyi il 27 Lug 2018
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?

Risposte (2)

Rishabh Gupta
Rishabh Gupta il 27 Lug 2018
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 il 27 Lug 2018
Modificato: Mykola Raievskyi il 27 Lug 2018
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

Categorie

Scopri di più su Programmatic Model Editing in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by