8

我想知道在matlab中将绘图保存到图像文件时,saveas和print有什么区别?什么情况下两者都可以用,什么情况下只能用一个?

谢谢并恭祝安康!

4

3 回答 3

9

我相信 SAVEAS 只是 PRINT 的包装。查看 SAVEAS(编辑 saveas)的源代码 - 大量参数检查,最后只有一个打印行。这两个函数都支持相同的格式。SAVEAS 的语法更简单一些。

来自 SAVEAS 的评论:"If you want to control the size or resolution of figures saved in image (bitmapped) formats (such as BMP or JPG), use the print command."

于 2010-03-21T19:04:07.963 回答
1

打印在其他方面也更加灵活。查看文档页面以进行打印 - 您可以复制到剪贴板(例如使用“print -dmeta”),当然也可以打印到打印机。

于 2010-03-22T19:19:14.050 回答
0

请改用 hgexport,如下所示:

hgexport(gcf, 'figure1.jpg', hgexport('factorystyle'), 'Format', 'jpeg');

来源: http ://www.mathworks.com/support/solutions/en/data/1-1PT49C/index.html?product=SL&solution=1-1PT49C

于 2013-07-27T22:44:00.607 回答