无法运行编译的Matlab代码,该代码使用“Presentation”生成报告

时间:2017-01-11 18:44:30

标签: matlab report powerpoint exe matlab-compiler

我正在尝试将使用“Presentation”(来自reportgen包)的简单程序转换为.exe。

代码如下:

makePPTCompilable();
import mlreportgen.ppt.*
slides = Presentation('mySlideAddPresentation.pptx');
slide1 = add(slides,'Title and Picture');
plane = Picture(which('tulips.jpg'));
plane.X = '4in';
plane.Y = '4in';
plane.Width = '5in';
plane.Height = '2in';
add(slide1,plane);
close(slides);

运行编译版本时出现以下错误:

“未定义函数'Presentation'用于'char'”

类型的输入参数

知道我在这里缺少什么吗?我在2015b,使用以下链接寻求帮助:https://www.mathworks.com/help/rptgen/ug/compile-a-presentation-program.html

1 个答案:

答案 0 :(得分:0)

您需要对reportgen进行编辑,请参阅herehere

在我的代码中,我说:

  if ismcc || isdeployed
    % Make sure DOM is compilable
    makeDOMCompilable()
  end

然后编译好! :)