matlab Presentation,Create a Presentation Generator

Create a Presentation Generator

You can use the MATLAB® API for PowerPoint® (PPT API) to update and create PowerPoint presentations programmatically. For example, this MATLAB script creates a presentation that has a title page and one content slide

with a bulleted list.

import mlreportgen.ppt.*;

slidesFile = 'mySlides.pptx';

slides = Presentation(slidesFile);

slide1 = add(slides,'Title Slide');

replace(slide1,'Title','My Presentation');

replace(slide1,'Subtitle','Create a Presentation Program');

slide2 = add(slides,'Title and Content');

para = Paragraph('First Content Slide');

para.FontColor = 'blue';

replace(slide2,'Title',para);

replace(slide2,'Content',{'First item','Second item','Third item'});

close(slides);

After you create the presentation, which is named MySlides.pptx,

you can open it. On a Windows® platform, you can open the presentation in MATLAB:

if ispc

winopen(slidesFile);

end

The generated presentation MySlides.pptx includes these two

slides.

98a05c7fadacd0d6f0da1899b5ecb0af.pngUpdate Presentation Content

PPT API programs generally include code that:

Imports the mlreportgen.ppt API package. To omit the

package name when you invoke PPT API object constructors and method, import

the package.

import mlreportgen.ppt.*;

Creates a Presentation object to:

Hold the presentation contents

Specify the output location for the generated presentation

Indicate the PowerPoint template

The following code creates a presentation using the template from

the presentation in the file mySlides.pptx and

overwrites mySlides.pptx with the new

presentation.

slidesFile = 'mySlides.pptx';

slides = Presentation(slidesFile, slidesFile);

open(slides);

Adds or replaces slide content.

slide2 = slides.Children(2);

contents = find(slide2,'Title');

replace(contents,Paragraph('Modified Content Slide'));

contents = find(slide2,'Content');

datePara = Paragraph('Fourth item: Updated item');

add(contents,datePara);

The PPT API replaces PowerPoint template placeholders with content defined in the program. In

the template, you can interactively add placeholders or rename placeholders

for your program to interact with.

Closes the presentation, which generates the content and formatting of the

presentation.

close(slides);

You can include code to open the presentation on Windows platforms. Use winopen with the name of the file,

which in this case is stored in the slidesFile variable.

if ispc

winopen(slidesFile);

end

The updated slide looks like this:

e9c69791ad6be81657d3782bac3b170f.png

To see another example of a PPT API program in MATLAB, enter population_slides. (To run this example on

Linux®, you must have Open Office software installed.)Two Ways to Use the PPT API

You can create a PPT API program that:

Replaces content in, or adds content to, an existing PowerPoint presentation

Generates a complete PowerPoint presentationAdd Content to an Existing Presentation

To add or update content to an existing presentation without manually updating

the presentation each time content changes, use the PPT API. This approach is

useful when you want to use most of the content and formatting in an existing

presentation.

You can use the PPT API and MATLAB functions to generate content for a presentation from

MATLAB code and Simulink® models.

You can update a presentation by overwriting the presentation file or

create a separate version of the presentation with a different

presentation name.Create a Complete Presentation

To create a complete presentation when you want to use the same content using

multiple PowerPoint templates, use the PPT API.PPT API Applications and PowerPoint Templates

The PPT API uses PowerPoint presentations as templates to generate presentations. Templates allow you to

specify the fixed content and default layout and appearance of the slides in your

presentations. Your MATLAB program can use the PPT API to override the default layout and format of

specific slides.

The template can be an empty presentation or a presentation with slides. You can use the

following as templates for a PPT API presentation:

The default PPT API PowerPoint template

A customized copy of the default PPT API PowerPoint template

An existing PowerPoint presentation whose content

you want to update

A PowerPoint template that you create or update interactively in PowerPointTemplate Elements

PowerPoint templates include several elements that the

PPT API uses to generate a presentation. To customize formatting defined

in a template, modify one or more of these template elements.

PowerPoint Template ElementPurposeSlide mastersApplies the slide master formatting globally to the presentation.

Specifies a layout and formats common to a set of slide layouts

Slide layoutsSpecifies a variant of a slide master layout.

Table stylesSpecifies the default appearance of a table. PowerPoint defines

a standard set of table styles. You cannot modify these styles but

you can use the PPT API to apply these styles to tables you create

and override the styles for particular tables.

PlaceholdersSpecifies an area of a slide layout that you can replace

with text, a list, picture, table, or other content. Every placeholder

has a name. You can use PowerPoint interactively to assign a

name to a placeholder. You can then use the name in your PPT program

to replace the placeholder with content.

Related Topics

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android是一种基于Linux内核(不包含GNU组件)的自由及开放源代码的移动操作系统,主要应用于移动设备,如智能手机和平板电脑。该系统最初由安迪·鲁宾开发,后被Google公司收购并注资,随后与多家硬件制造商、软件开发商及电信营运商共同研发改良。 Android操作系统的特点包括: 开放源代码:Android系统采用开放源代码模式,允许开发者自由访问、修改和定制操作系统,这促进了技术的创新和发展,使得Android系统具有高度的灵活性和可定制性。 多任务处理:Android允许用户同时运行多个应用程序,并且可以轻松地在不同应用程序之间切换,提高了效率和便利性。 丰富的应用生态系统:Android系统拥有庞大的应用程序生态系统,用户可以从Google Play商店或其他第三方应用市场下载和安装各种各样的应用程序,满足各种需求。 可定制性:Android操作系统可以根据用户的个人喜好进行定制,用户可以更改主题、小部件和图标等,以使其界面更符合个人风格和偏好。 多种设备支持:Android操作系统可以运行在多种不同类型的设备上,包括手机、平板电脑、智能电视、汽车导航系统等。 此外,Android系统还有一些常见的问题,如应用崩溃、电池耗电过快、Wi-Fi连接问题、存储空间不足、更新问题等。针对这些问题,用户可以尝试一些基本的解决方法,如清除应用缓存和数据、降低屏幕亮度、关闭没有使用的连接和传感器、限制后台运行的应用、删除不需要的文件和应用等。 随着Android系统的不断发展,其功能和性能也在不断提升。例如,最新的Android版本引入了更多的安全性和隐私保护功能,以及更流畅的用户界面和更强大的性能。此外,Android系统也在不断探索新的应用场景,如智能家居、虚拟现实、人工智能等领域。 总之,Android系统是一种功能强大、灵活可定制、拥有丰富应用生态系统的移动操作系统,在全球范围内拥有广泛的用户基础。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值