replace
Class: mlreportgen.ppt.TemplateTable
Namespace: mlreportgen.ppt
Replace template table with another table
Syntax
newTable = replace(templateTable,replacementTable)
Description
replaces a template table with another table.newTable = replace(templateTable,replacementTable)
Input Arguments
Template table to replace, specified as an
mlreportgen.ppt.TemplateTable object.
Replacement table, specified as an mlreportgen.ppt.Table
object.
Output Arguments
New table in the presentation slide, specified as an
mlreportgen.ppt.Table object.
Examples
Generate a presentation, MyTablePresentation, that you then use as the template presentation for another presentation. MyTablePresentation has one slide with one table
import mlreportgen.ppt.* ppt = Presentation("MyTablePresentation"); open(ppt); slide1 = add(ppt,"Title and Table"); replace(slide1,"Title","Magic Square Slide 1"); replace(slide1,"Table",Table(magic(3)));
Close and view the presentation.
close(ppt); rptview(ppt);
Create a presentation, MyNewTablePresentation, from MyTablePresentation. MyTablePresentation is the template presentation for MyNewTablePresentation,
ppt = Presentation("MyNewTablePresentation","MyTablePresentation"); open(ppt);
Find the template table by using the find method of the slide object. Because the table comes from a template presentation slide, find returns the table as an mlreportgen.ppt.TemplateTable object.
slide1 = ppt.Children(1);
templateTableObj1 = find(slide1,"Table")templateTableObj1 =
TemplateTable with properties:
XMLMarkup: '<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id="3" name="Table"/><p:cNvGraphicFramePr><a:graphicFrameLocks noGrp="1"/></p:cNvGraphicFramePr><p:nvPr><p:ph idx="1" type="tbl"/></p:nvPr></p:nvGraphicFramePr><p:xfrm><a:off x="838200" y="1825625"/><a:ext cx="10515600" cy="4351338"/></p:xfrm><a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/table"><a:tbl><a:tblPr bandRow="1" firstRow="1"/><a:tblGrid><a:gridCol w="3505200"/><a:gridCol w="3505200"/><a:gridCol w="3505200"/></a:tblGrid><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>8</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>1</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>6</a:t></a:r></a:p></a:txBody></a:tc></a:tr><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>3</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>5</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>7</a:t></a:r></a:p></a:txBody></a:tc></a:tr><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>4</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>9</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>2</a:t></a:r></a:p></a:txBody></a:tc></a:tr></a:tbl></a:graphicData></a:graphic></p:graphicFrame>'
Name: 'Table'
X: '838200emu'
Y: '1825625emu'
Width: '10515600emu'
Height: '4351338emu'
Style: []
Children: []
Parent: [1×1 mlreportgen.ppt.Slide]
Tag: 'ppt.TemplateTable:883:428'
Id: '883:428'
Replace the table on the slide with a table for a 4-by-4 magic square.
replace(templateTableObj1,Table(magic(4)));
Close and view the presentation.
close(ppt); rptview(ppt);
Version History
Introduced in R2019b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)