This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This has been verified as a bug in MATLAB 6.0 (R12) through MATLAB 7.0 (R14) in the way that the PRINT function operates with the append option when there are other files of the desired filename on the MATLAB path, but there is no file of the desired filename in the directory in which the file is to be written.
Currently, to work around this issue, you can either remove or rename the files on the path which have the same filename as that desired for the figure being exported, or you can use a script similar to the following example to ensure that the append option is left off if there is another file of the same name on the path:
filename = 'sampleFile.ps';
onpath = which(filename,'-all');
if ~isempty(onpath)
if isempty(dir(filename))
print('-dpsc2', '-painters', '-noui', filename);
else
print('-dpsc2', '-painters', '-noui', '-append', filename);
end
else
print('-dpsc2', '-painters', '-noui', filename);
end
Best Answer