Save a Matlab figure without showing it

164 views
Skip to first unread message

Haifeng GONG

unread,
Aug 30, 2010, 3:34:38 PM8/30/10
to MathTools
Sometimes, we need to save a Matlab figure without showing it. For
example, if we use Matlab via ssh, showing figures makes the program
quite slow.


figure('visible', 'off');
t=0:0.1:2*pi;
plot(sin(t)+sin(2*t), cos(t)+cos(2*t))
saveas(gcf, 'hello.pdf');

Reply all
Reply to author
Forward
0 new messages