matlab代码完成copy figure功能

整理自百度知道: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')

posted @ 2018-11-14 15:45  Dontstop  阅读(3446)  评论(0编辑  收藏  举报