Main Content

mlreportgen.report.Section.number

Class: mlreportgen.report.Section
Namespace: mlreportgen.report

Set section numbering

Syntax

mlreportgen.report.Section.number(report,numbering)

Description

mlreportgen.report.Section.number(report,numbering) indicates whether to include numbers before report section titles. Report sections are numbered consecutively by default.

Input Arguments

expand all

Report, specified as a mlreportgen.report.Report object.

Whether to number sections, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — The report sections are numbered consecutively.

  • 0 (false) — The numbers are not included for report sections.

You can use the Numbered property of a section to override the numbering for that section.

Attributes

Statictrue

To learn about attributes of methods, see Method Attributes.

Examples

expand all

Turn off section numbering in a Report API report.

import mlreportgen.report.*
import mlreportgen.dom.*
rpt = Report("My Report","pdf");
add(rpt,TitlePage("Title","My Report",...
     "Author","MathWorks"));
add(rpt,TableOfContents);
add(rpt,Chapter("Title","Boeing 747",...
     "Content","This report describes the Boeing 747."));
KeepWithNext(1);
add(rpt,Section("Title","Image of Boeing 747",...
     "Content",Image(which("b747.jpg")),"Numbered",0));
close(rpt);
rptview(rpt);

Version History

Introduced in R2017b