Save Matlab figure without plotting it?

后端 未结 2 1980
醉酒成梦
醉酒成梦 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:30

    There is also the saveas(h,'filename.ext') function which can save a figure in some formats.

    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题