add

Class: mlreportgen.report.Section
Package: mlreportgen.report

Add section content

Syntax

add(section,content)

Description

add(section,content) adds content to this section.

Input Arguments

expand all

Section of the report, specified as a section reporter object. To create the section input, you use mlreportgen.report.Section.

Content of the section, specified as one of these values:

  • Most built-in MATLAB objects

  • DOM objects

  • Report API reporters

  • Object and cell arrays of objects that can be added individually to a section

Examples

Add Images to a Section

Add a title page, chapter, and a section that contains image objects.

import mlreportgen.report.*
import mlreportgen.dom.*
rpt = Report('My Report','pdf');
add(rpt,TitlePage('Title','My Report'));
ch = Chapter('Images');
add(ch, Section('Title', 'Boeing 747', ...
    'Content',Image(which('b747.jpg'))));
add(ch,Section('Title','Peppers', ...
    'Content',Image(which('peppers.png'))));
add(rpt,ch);
close(rpt);
rptview(rpt);

Introduced in R2017b