MATLAB Report Generator Task Examples

Report Generator sample tasks and associated code

These examples illustrate how to use the Report API to create and format report content.

Word

Page Layout

Create a Report With Landscape Pages

Generate a report that has landscape pages.

Create a Report With Portrait and Landscape Pages

Generate a report that has both portrait and landscape pages.

Set Page Margins in a Word Report

Define margins and header, footer, and gutter sizes for a DOCX page.

Side-By-Side Tables

Arrange tables next to each other on a page.

Fit Wide Tables in a Page

Slice a wide table to fit on a page.

Scale Image To Fit Page

Set image height and width to fit it on page.

Side-By-Side Images

Arrange images next to each other on a page.

Side-By-Side Figures

Arrange MATLAB figures next to each other on a page.

Specify Space Between Paragraphs

Change the spacing between paragraphs in a report.

Tables

Span a Table Entry Across Rows and Columns

Set table entry to span across rows or columns.

Aligning Table Entry Content Horizontally

Horizontally align table entries.

Set Table Column Width

Set table column widths.

Create a Zebra-Striped Table

Create striped table with alternating row colors.

Lists

Multilevel List

Create multilevel lists in HTML, PDF, or Word reports. Use cell arrays or List and ListItem objects.

Custom Styled Word List

Use a custom Word template to style a multilevel list.

Numbering

Number Section Headings, Table Titles, and Figure Captions Programmatically

Create numbered chapter and subsection headings.

Programmatically Number Pages

Use the DOM and Report APIs to number Word or PDF pages.

Number Pages in a Word Template

Specify page numbering in a report by customizing a Word template.

Images, Figures, and Equations

Create an Inline Equation in a Report

Insert inline equation in a line of text in a report.

Prevent MATLAB Figure Display During Report Generation

Make figure that you include in a report invisible in MATLAB.

PDF

Page Layout

Create a Report With Landscape Pages

Generate a report that has landscape pages.

Create a Report With Portrait and Landscape Pages

Generate a report that has both portrait and landscape pages.

Set Page Margins in a PDF Report

Define margins and header, footer, and gutter sizes for a PDF page.

Side-By-Side Tables

Arrange tables next to each other on a page.

Fit Wide Tables in a Page

Slice a wide table to fit on a page.

Scale Image To Fit Page

Set image height and width to fit it on page.

Side-By-Side Images

Arrange images next to each other on a page.

Side-By-Side Figures

Arrange MATLAB figures next to each other on a page.

Specify Space Between Paragraphs

Change the spacing between paragraphs in a report.

Tables

Span a Table Entry Across Rows and Columns

Set table entry to span across rows or columns.

Aligning Table Entry Content Horizontally

Horizontally align table entries.

Set Table Column Width

Set table column widths.

Create a Zebra-Striped Table

Create striped table with alternating row colors.

Excel to PDF

Create a PDF report from a Microsoft® Excel® spreadsheet.

Lists

Multilevel List

Create multilevel lists in HTML, PDF, or Word reports. Use cell arrays or List and ListItem objects.

Images, Figures, and Equations

Hyperlink Image

Add hyperlinks to an image.

Create an Inline Equation in a Report

Insert inline equation in a line of text in a report.

Prevent MATLAB Figure Display During Report Generation

Make figure that you include in a report invisible in MATLAB.

Numbering

Number Section Headings, Table Titles, and Figure Captions Programmatically

Create numbered chapter and subsection headings.

Programmatically Number Pages

Use the DOM and Report APIs to number Word or PDF pages.

Number Pages in a PDF Template

Specify page numbering in a report by customizing a PDF template.

HTML

Page Layout

Side-By-Side Tables

Arrange tables next to each other on a page.

Side-By-Side Images

Arrange images next to each other on a page.

Side-By-Side Figures

Arrange MATLAB figures next to each other on a page.

Specify Space Between Paragraphs

Change the spacing between paragraphs in a report.

Tables

Span a Table Entry Across Rows and Columns

Set table entry to span across rows or columns.

Set Table Column Width

Set table column widths.

Create a Zebra-Striped Table

Create striped table with alternating row colors.

Lists

Multilevel List

Create multilevel lists in HTML, PDF, or Word reports. Use cell arrays or List and ListItem objects.

Images, Figures, and Equations

Hyperlink Image

Add hyperlinks to an image.

Create an Inline Equation in a Report

Insert inline equation in a line of text in a report.

Prevent MATLAB Figure Display During Report Generation

Make figure that you include in a report invisible in MATLAB.

Numbering

Number Section Headings, Table Titles, and Figure Captions Programmatically

Create numbered chapter and subsection headings.