Main Content

replace

Class: mlreportgen.ppt.Table
Package: mlreportgen.ppt

Replace table with another table

Description

example

tableObj = replace(table,replacementTable) replaces a table with another table.

Examples

expand all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myTableReplacePresentation.pptx';
slides = Presentation(slidesFile);
slide1 = add(slides,'Blank');

Create an mlreportgen.ppt.Table object.

t1 = Table(magic(7));
t1.X = '2in';
t1.Y = '2in';
t1.Width = '6in';
t1.Height = '4in';

Search in slide1 for Table.

add(slide1,t1);

Create another mlreportgen.ppt.Table object.

t2 = Table(magic(9));
t2.X = '2in';
t2.Y = '2in';
t2.Width = '7in';
t2.Height = '5in';

Replace t1 with t2.

replace(t1,t2);

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

expand all

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

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

Output Arguments

expand all

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

Introduced in R2015b