Hi everyone!
I have a main funtion which calls ExecuteMFiles() at certain point. I also have an inputdocPath to a folder with many different files ( .dat, .m, etc.), these files have an important information in their name so it can't be changed but unfortunatelly they are written starting with numers and dots (eg "32.521_parameter.m") which I know it's one of the very first rules to not follow so what I've done is make a copy, execute it and delete it.
That's done for each .m file so I can run it without an error in MATLAB R2016b but when I use R2015b version, someting wrong happends. If I run my main code in R2015b I get an error in relation with non-seen parameters which should been defined while running ExecuteMFiles() but if I use debugging from copyfile() line and then I go step by step, all the .m file run well so I'm confused!
Could anyone help me with this? I let you here the ExecuteMFiles()'s first part (the second part is just the assigment of names for each parameter in the workspace) which I guess it's failing for something.
function ctl = ExecuteMFiles( inputdocPath )cd (inputdocPath);found = dir(fullfile(inputdocPath, '*.m') );for iF = 1:length(found) %run all *.m file with parameters
copyfile(found(iF).name,'copy.m'); eval('copy'); delete('copy.m');end
Thank you very much!
Best Answer