首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在matlab中更改演示的路径?

如何在matlab中更改演示的路径?
EN

Stack Overflow用户
提问于 2016-11-23 02:23:51
回答 1查看 70关注 0票数 0

我是用Matlab编程的新手。导入以下类:mlreportgen.ppt.*,将在当前文件夹中创建演示文稿。但是,我希望在不同的位置生成演示文稿。找到了以下语法,但我不确定如何实现它:

代码语言:javascript
复制
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.

在我的代码中,使用以下代码在演示文稿中生成幻灯片:

代码语言:javascript
复制
slides = Presentation(outputFile, strcat('template_', num2str(number_of_devices))); "
where outputfile = strcat ('name','.pptx')
EN

回答 1

Stack Overflow用户

发布于 2016-11-25 05:07:03

你需要在outputFile中提供一个完整的路径,否则默认情况下会在当前的matlab路径下创建该文件。

在创建演示对象之前,只需编写:

代码语言:javascript
复制
outputfile = 'c:\path\to\your\file.pptx' (windows)
outputfile = '/path/to/your/file.pptx' (linux)

还可以使用以下命令更改当前的matlab文件夹:

代码语言:javascript
复制
cd(newCurrentFolder)

您还应该避免使用strcat作为path。strcat从字符串中删除尾随空格,这有时可能会有问题。请改用cat()或方括号[str1 str2 ...]

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40749025

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档