print(gcf,'-dpng','abc.png') 更加详细的解释可以参考下面的链接: https://ink-bottle.github.io/2019/03/25/MATLAB%E6%95%B0%E5%AD%97%E5%9B%BE%E5%83%8F%E5%A4%84%E7%90%86%E5%AD%A6%E4%B9%A0%EF%BC%88%E4%BA%94%EF%BC%89-%E5%B0%86%E5%9B%BE%E7%AA%97%E4%BF%9D%E5%AD%98%E4%B8%BA%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F/