I'm trying to save models in oldest MATLAB versions as below I look for each folder and subfolder to find any .mdl or .slx to save it as 2007b version
The problem I have is :
- it works if I just look for one extension whereas I'm wondering to do that on each .mdl and.slx .
- the save_system takes too much time
Do you know how could I get all .mdl and .slx and is there an optimized way to save ?
Thanks
rootPath = fullfile('M:\script\ytop','tables');
files = dir(rootPath );
for ii = 3:numel(files)
x = fullfile(rootPath ,files(ii).name);
cd(x);
mdl = { dir('*.mdl'),dir('*.slx')}; % here it works if only I set dir('*.mdl')
for jj = 1:numel(mdl)
load_system(mdl(jj).name);
save_system(mdl(jj).name,mdl(jj).name, 'SaveAsVersion','R2007b');
end
end
Mdrive? If you did this (without loading or saving files), you could see how fast the connection is. Try this with the same file(s) and compare if this time is proportional.