append
Class: mlreportgen.report.Section
Namespace: mlreportgen.report
Syntax
append(section,content)
Input Arguments
section
— Section of the report
mlreportgen.report.Section
object
Section of the report, specified as an mlreportgen.report.Section
object.
content
— Content to add to section
Report API reporter | DOM object | MATLAB built-in object | cell array of objects
Content to add to the section, specified as one of these values:
Report API reporter
DOM object
Built-in MATLAB® object (most built-in MATLAB objects can be added to a
Section
reporter)Cell array of objects that can be added individually to a section
Examples
Add Content to a Section
This example generates a report that has a title page and one chapter. The chapter contains two sections, each of which contains an image. The example uses append
to add the content to the images, the images to the sections, the sections to the chapter, and the chapter and title page to the report.
Import the DOM and API packages so that you do not have to use long, fully qualified class names.
import mlreportgen.report.* import mlreportgen.dom.*
Create a report and add a title page to the report.
rpt = Report("My Report","pdf"); append(rpt,TitlePage("Title","My Report"));
Create a chapter with two sections. Add an image to each section. Add the sections to the chapter and the chapter to the report.
ch = Chapter("Images"); sect1 = Section("Boeing 747"); append(sect1,Image("b747.jpg")); append(ch,sect1); sect2 = Section("Peppers"); append(sect2,Image("peppers.png")); append(ch,sect2); append(rpt,ch);
Close and view the report.
close(rpt); rptview(rpt);
Version History
Introduced in R2020b
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)