Hi, I would like to implement an algorithm that fill the sldd from a model. The problem is that all the new object added have the default StorageClass Auto. How can I change it from command?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Handles_cal=find_system(load_system('name_model'),'MaskPropertyNameString','CAL_BLK_NAME'); for i=1:length(Handles_cal) NAME=get(Handles_cal(i),'CAL_BLK_NAME'); myDictionaryObj = Simulink.data.dictionary.open('name_model.sldd'); sectionObj = myDictionaryObj.getSection('Design Data'); eval(sprintf('%s',[NAME '=Simulink.Parameter;'])) SignalName = Simulink.Parameter; SignalName.Value = 0; SignalName.Description='Description'; entryObj = addEntry(sectionObj,NAME,Simulink.Parameter); end
0 commentaires
Réponses (1)
Donn Shull
le 16 Déc 2017
Based on the code from your question you could create the parameters with Storage Class 'Imported Extern' as follows:
Handles_cal=find_system(load_system('name_model'),'MaskPropertyNameString','CAL_BLK_NAME');
myDictionaryObj = Simulink.data.dictionary.open('name_model.sldd');
sectionObj = myDictionaryObj.getSection('Design Data');
for i=1:length(Handles_cal)
NAME=get(Handles_cal(i),'CAL_BLK_NAME');
param = Simulink.Parameter;
param.CoderInfo.StorageClass = 'ImportedExtern';
entryObj = addEntry(sectionObj, NAME, param);
end
0 commentaires
Voir également
Catégories
En savoir plus sur Manage Design Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!