整理自百度知道:https://zhidao.baidu.com/question/482507465.html

在写报告的过程中经常碰到需要大量复制粘贴matlab生成的图片到word中,在不太正式的报告里一般用工具栏中的copy figure完成复制过程,一张图一张图地粘会非常麻烦,若要通过编写代码实现copy figure的功能,可使用以下函数:

print -dmeta

print -dbitmap

uimenufcn(gcf, \’EditCopyFigure\’)

hgexport(gcf,\’-clipboard\’)

由于要用到gcf,需要画一张粘一张,当图片比较多时可以配合pause函数使用,如下:

figure(1)

hgexport(gcf,\’-clipboard\’)

pause

figure(2)

hgexport(gcf,\’-clipboard\’)

pause

figure(3)

hgexport(gcf,\’-clipboard\’)

pause

figure(4)

hgexport(gcf,\’-clipboard\’)

版权声明:本文为Dontstop原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/Dontstop/p/9958305.html