Skip to content
Snippets Groups Projects
Commit 06ecfecb authored by Cristian Galperti's avatar Cristian Galperti Committed by Cristian Galperti
Browse files

exported configurations .m are not put in a subfolder

parent 837bbc20
No related branches found
No related tags found
No related merge requests found
configurations.sldd
configurationSettings*
exportedcfgs
......@@ -9,10 +9,18 @@ dict_name='configurations_container';
hDict = Simulink.data.dictionary.open([dict_name,'.sldd']);
hDesignData = hDict.getSection('Configurations');
childNamesList = hDesignData.evalin('who');
curpath=pwd;
[fcnpath,~,~]=fileparts(mfilename('fullpath'));
try
system(['cd ' fcnpath '; mkdir exportedcfgs']);
for n = 1:numel(childNamesList)
hEntry = hDesignData.getEntry(childNamesList{n});
fprintf('Exporting %s to base workspace and %s.m ...\n',hEntry.Name,hEntry.Name);
assignin('base', hEntry.Name, hEntry.getValue);
evalin('base', [hEntry.Name '.saveAs(''' hEntry.Name ''');']);
evalin('base', [hEntry.Name '.saveAs(''' fcnpath '/exportedcfgs/' hEntry.Name ''');']);
end
catch ME
report = getReport(ME)
system(['cd ' curpath]);
end
system(['cd ' curpath]);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment