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.

getCaptionReporter

Class: mlreportgen.report.FormalImage
Package: mlreportgen.report

Get image caption reporter

Syntax

reporter = getCaptionReporter(image)

Description

reporter = getCaptionReporter(image) returns a reporter that generates the formal image caption based on the Caption property of mlreportgen.report.FormalImage. The caption can be any MATLAB® or DOM object that can be appended to a DOM Paragraph. The caption formats override any corresponding formats in the template. Use this getCaptionReporter method to override the default caption formats.

Input Arguments

expand all

Source of image to add to report, specified as a character vector or character array, or as a DOM Image object. If you use a character vector or character array, specify the system path to the image file.

Output Arguments

expand all

Formal image caption reporter for the image, returned as a reporter object.

Examples

Use Non-Default Caption Style

Create a style for your caption that differs from the default style. Before you run this example, create a template named MyCaptionTemplate and customize its FormalImageCaption style. Then, use the getCaptionReporter method and the TemplateSrc property to use your template.

import mlreportgen.report.*
report = Report();
image = FormalImage();
captionReporter = getCaptionReporter(image);
image.TemplateSrc = 'MyCaptionTemplate';
add(report,image);

Introduced in R2017b

Was this topic helpful?