Main Content

replace

Class: mlreportgen.ppt.Table
Namespace: mlreportgen.ppt

Replace table with another table

Description

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

example

Examples

expand all

Create a presentation.

import mlreportgen.ppt.*

ppt = Presentation("myTableReplacePresentation.pptx");
open(ppt);
slide1 = add(ppt,'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(ppt);
rptview(ppt);

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.

Version History

Introduced in R2015b