Effacer les filtres
Effacer les filtres

Structure arrays in Matlab2016

4 vues (au cours des 30 derniers jours)
Mykola Raievskyi
Mykola Raievskyi le 17 Juil 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?

Réponses (2)

Rishabh Gupta
Rishabh Gupta le 27 Juil 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 le 27 Juil 2018
Modifié(e) : Mykola Raievskyi le 27 Juil 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

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by