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 visualización (últimos 30 días)
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

Respuestas (1)

Donn Shull
Donn Shull el 16 de Dic. de 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

Categorías

Más información sobre Manage Design Data en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by