mlreportgen.ppt.TablePlaceholder.replace

Package: mlreportgen.ppt

Replace table in table placeholder

Syntax

tableObj = replace(tablePlaceholder,table)

Description

example

tableObj = replace(tablePlaceholder,table) replaces the table in a table placeholder.

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myTableReplacePresentation.pptx';
slides = Presentation(slidesFile);
slide1 = add(slides,'Title and Table');

Create an mlreportgen.ppt.Table object.

t1 = Table(magic(7));

Search in slide1 for Table.

contents = find(slide1,'Table');

Replace the first table placeholder whose Name property is Table with a table.

replace(contents(1),t1);

Generate the presentation. Open myTableReplacePresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

close(slides);

if ispc
    winopen(slidesFile);
end

Input Arguments

collapse all

Table placeholder to replace table, specified as an mlreportgen.ppt.TablePlaceholder object.

Table to use as a replacement, specified as an mlreportgen.ppt.Table object.

Output Arguments

collapse all

Table, returned as an mlreportgen.ppt.Table object.

Introduced in R2015b