MATLAB: How to stop a print after canceling at the print setup menu

cancel printMATLABprintprint setup

Hi All. So I have the following lines in my code:
1. set(gcf,'PaperPositionmode','auto');
2. print(gcf,'-dsetup');
3. print(gcf);
Line two brings up the printer setup menu. But if I cancel from there, line three will still send the current figure to my default printer. I don't want this to happen but since print cannot return a value I am having troubling thinking of a way around this. Any ideas?

Best Answer

solution:
Just use print(gcf,'-v') instead
Related Question