Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

clone

Class: mlreportgen.dom.Container
Package: mlreportgen.dom

Copy container object

Syntax

clonedContainer = clone(sourceContainer)

Description

clonedContainer = clone(sourceContainer) copies (clones) the specified container.

Input Arguments

expand all

Container object to copy, specified as an mlreportgen.dom.Container object.

Output Arguments

expand all

Copied container object, returned as an mlreportgen.dom.Container object.

Examples

expand all

Create a container object. Microsoft® Word output ignores the HTML container element tag (in this example, the div tag).

import mlreportgen.dom.*;
rpt = Document('MyReport','docx');
 
c = Container();

Color all of the text in this container red.

c.Style = {Color('red')};

Append content to the container and append the container to the report.

append(c,Paragraph('Hello'));
append(c,Table(magic(5)));
append(rpt,c);

Clone the container.

clonedC = clone(c);

Append the cloned container to the report.

append(rpt,clonedC);

Close and generate the report.

close(rpt);      
rptview(rpt.OutputPath);

Introduced in R2015a

Was this topic helpful?