Hi guys,
My knowledge of MatLab (and coding in general) is extremely limited so I would appreciate if someone could help me with this.
So, I have an iteration in MatLab and at the end of each step a variable 'F' is calculated. Ideally, I would like to save a new file (.mat) each time to the 'Current Folder' as F1, F2, F3, etc.
Right now what I have is this:
for p=1:pillar;
directory=[pwd '\pillar_' num2str(p)] cd(directory)
(more stuff inbetween)
F =d*(1/0.93)*3.25;
save (num2str(p), 'F')
end
In each iteration this code is saving the variable 'F' as 1, 2, 3, etc, in the 'Current Folder', which would be okay.
The problem is that I have to load all the files into the workspace when the iteration is complete. When I load the file '1.mat' it appears into the workspace as 'F'; then I load the file '2.mat' and it overwrites the previous file because it also appears as 'F'; etc.
So I need a way to save the variable 'F' in each iteration that will allow me at the end to just load all the files without overwriting the previous one.
Thanks, Ricardo
Best Answer