在mlreportgen.dom之后,Matlab没有回应。*

时间:2017-08-01 18:27:22

标签: matlab matlab-figure

我正在尝试将图像放入word文档中。在我下面运行这个脚本后,我得到一张带有图片的文字。到目前为止,一切都很好。当我再次运行脚本时,问题就开始了。 Matlab无法完成脚本,我每次都要重启Matlab,这非常烦人。似乎存在一些冲突。我尝试在第一次运行后和第二次运行之前删除pic和word文档,但这没有帮助。

import mlreportgen.dom.*
d = Document('imageArea','docx');


x = 0:pi/100:2*pi;  %Plot
y = sin(x);
plot(x,y);


saveas(gcf,'myPlot_img.png'); % Save figure in folder


plot1 = Image('myPlot_img.png'); % Append plot to word file
plot1.Style={ScaleToFit}; 
append(d,plot1);

close(d); % Close
rptview(d.OutputPath);

请帮助。谢谢

0 个答案:

没有答案
相关问题