I am running a script repeatedly each time changing a few parameters, each time evaluation takes at least a few hours. At the end of my code, I put
save('myfilename.mat').
Now, each time, I have to ensure I change myfilename to avoid any data gets overwritten. Is there a way to ensure that if 'myfilename.mat' already exists, matlab saves the second .mat file as 'myfilename(1).mat' etc?
Best Answer