手动选择文件:
% select .xx file,xx替换为所需格式,文件路径字符串存于DDFile变量中 [xxfile,~,~] = uigetfile('*.xx','Select xx file'); if xxFile == 0 return; end
sldd to .m
% open .sldd file MyDictObj = Simulink.data.dictionary.open('sldd file path'); % export data dictionary entries to mat or matlab file DataSectObj = getSection(MyDictObj,'Design Data'); % 导出到'file name.m'文件中 exportToFile(DataSectObj,'file name.m');
.m to sldd
% open .sldd file MyDictObj = Simulink.data.dictionary.open('[sldd file path]'); % export data dictionary entries to mat or matlab file DataSectObj = getSection(MyDictObj,'Design Data');
%导入sldd
ImportedVars = importFromFile(DataSectObj,'[yourfile].m','existingVarsAction','overwrite');
saveChanges(MyDictObj)
标签:MyDictObj,simulink,sldd,xx,file,DataSectObj,open,字典 From: https://www.cnblogs.com/connection0x00/p/17761094.html