Main Content



Get image caption reporter


reporter = getCaptionReporter(image)


reporter = getCaptionReporter(image) returns a reporter that generates the formal image caption based on the Caption property of 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.


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.

rpt = Report();
image = FormalImage();
captionReporter = getCaptionReporter(image);
image.TemplateSrc = 'MyCaptionTemplate';

Version History

Introduced in R2017b