【问题标题】:Unable to run compiled Matlab code that uses "Presentation" for report generation无法运行使用“演示文稿”生成报告的已编译 Matlab 代码
【发布时间】:2017-01-11 18:44:29
【问题描述】:

我正在尝试将使用“演示文稿”(来自 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);

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

" 'char' 类型的输入参数的未定义函数 'Presentation'"

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

【问题讨论】:

  • 您提供的链接用于 R2016b 文档。您是否检查过 R2015b 文档以查看该版本中是否存在该功能?

标签: matlab report powerpoint exe matlab-compiler


【解决方案1】:

您需要使reportgen 可编译,请参阅herehere

在我的代码中:

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

然后它编译正常! :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-23
    • 2013-08-11
    • 1970-01-01
    • 2020-05-20
    • 2018-03-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多