Saving of MATLAB Image File not consistent
I have written a code to generate several plots from an array of data. Whenever I am trying to save those image files by savefig (for .fig Matlab files) or by saveas as jpeg or eps format, the saving of the image files is inconsistent. For a group of plots, savefig(‘FileName.fig’) and saveas(gcf,’FileNameeps’,’eps’) are working, i.e., images are saved in the current folder. However, sometimes the newly generated plots are not overwriting the previously generated plots (for some other runs) in the folder.
I have tried including the following before each plot:
delete FileName FileNameeps
But the problem persists. Only when I manually delete all the previous image files from the previous runs for the current folder, newer plots are saved. What can be a fix? Such problem did not occur when I had to generate fewer plots (as in codes generating one dozen plots in stead of some 4 dozen plots)
Thanks in advance.I have written a code to generate several plots from an array of data. Whenever I am trying to save those image files by savefig (for .fig Matlab files) or by saveas as jpeg or eps format, the saving of the image files is inconsistent. For a group of plots, savefig(‘FileName.fig’) and saveas(gcf,’FileNameeps’,’eps’) are working, i.e., images are saved in the current folder. However, sometimes the newly generated plots are not overwriting the previously generated plots (for some other runs) in the folder.
I have tried including the following before each plot:
delete FileName FileNameeps
But the problem persists. Only when I manually delete all the previous image files from the previous runs for the current folder, newer plots are saved. What can be a fix? Such problem did not occur when I had to generate fewer plots (as in codes generating one dozen plots in stead of some 4 dozen plots)
Thanks in advance. I have written a code to generate several plots from an array of data. Whenever I am trying to save those image files by savefig (for .fig Matlab files) or by saveas as jpeg or eps format, the saving of the image files is inconsistent. For a group of plots, savefig(‘FileName.fig’) and saveas(gcf,’FileNameeps’,’eps’) are working, i.e., images are saved in the current folder. However, sometimes the newly generated plots are not overwriting the previously generated plots (for some other runs) in the folder.
I have tried including the following before each plot:
delete FileName FileNameeps
But the problem persists. Only when I manually delete all the previous image files from the previous runs for the current folder, newer plots are saved. What can be a fix? Such problem did not occur when I had to generate fewer plots (as in codes generating one dozen plots in stead of some 4 dozen plots)
Thanks in advance. matlab plots, savefig, saveas MATLAB Answers — New Questions