我是用Matlab编程的新手。导入以下类:mlreportgen.ppt.*,将在当前文件夹中创建演示文稿。但是,我希望在不同的位置生成演示文稿。找到了以下语法,但我不确定如何实现它:
presentationObj = Presentation() creates a presentation named Untitled.pptx in the current folder, using the default PPT API default.pptx template.
presentationObj = Presentation(presentationPath) creates a presentation at the specified location.
presentationObj = Presentation(presentationPath,templatePath) creates a presentation using the PowerPoint template at the specified location.在我的代码中,使用以下代码在演示文稿中生成幻灯片:
slides = Presentation(outputFile, strcat('template_', num2str(number_of_devices))); "
where outputfile = strcat ('name','.pptx')发布于 2016-11-25 05:07:03
你需要在outputFile中提供一个完整的路径,否则默认情况下会在当前的matlab路径下创建该文件。
在创建演示对象之前,只需编写:
outputfile = 'c:\path\to\your\file.pptx' (windows)
outputfile = '/path/to/your/file.pptx' (linux)还可以使用以下命令更改当前的matlab文件夹:
cd(newCurrentFolder)您还应该避免使用strcat作为path。strcat从字符串中删除尾随空格,这有时可能会有问题。请改用cat()或方括号[str1 str2 ...]。
https://stackoverflow.com/questions/40749025
复制相似问题