Save Matlab figure without plotting it?

后端 未结 2 1987
醉酒成梦
醉酒成梦 2021-02-14 00:58

Is there a way of saving a figure plot without actually plotting it? I mean, let\'s say I want to save the graph for plot(1:10, (1:10).^2), can I save it without sh

2条回答
  •  悲哀的现实
    2021-02-14 01:31

    This can be done:

    set(gcf,'Visible','off');
    plot((1:10),(1:10).^2);
    print -dpng c:\chris.png  % or whatever your print command is
    

提交回复
热议问题