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 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Donn Shull
2017 年 12 月 16 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Manage Design Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!