MATLAB脚本操作数据字典(sldd)
sldd_file = 'Data_dictionary.sldd';
myDictionaryObj = Simulink.data.dictionary.open(sldd_file);
dDataSectObj = getSection(myDictionaryObj, 'Design Data');
variablesInfo = find(dDataSectObj);
for i = 1:length(variablesInfo)
param_name = variablesInfo(i).Name;
param = getEntry(dDataSectObj,param_name);
param_value = param.getValue;
param_value.Value = csv_data{index,2};
Variable = getEntry(dDataSectObj, param_name);
setValue(Variable,param_value);
end
saveChanges(myDictionaryObj)
close(myDictionaryObj);