主要内容

本页采用了机器翻译。点击此处可查看英文原文。

getCaptionReporter

类: mlreportgen.report.FormalImage
命名空间: mlreportgen.report

获取图像标题报告器

语法

reporter = getCaptionReporter(image)

说明

reporter = getCaptionReporter(image) 返回一个报告器,该报告器根据 mlreportgen.report.FormalImageCaption 属性生成正式的图像题注。题注可以是任何可以追加到 DOM 段落的 MATLAB® 或 DOM 对象。题注格式将覆盖模板中任何相应的格式。使用此 getCaptionReporter 方法来覆盖默认的题注格式。

输入参数

全部展开

要添加到报告中的图像源,指定为字符向量或字符数组,或 DOM 图像对象。如果使用字符向量或字符数组,请指定图像文件的系统路径。

输出参量

全部展开

图像的正式图像题注报告器,作为报告器对象返回。

示例

使用非默认题注样式

为您的题注创建一种不同于默认样式的样式。

  1. 创建一个名为 MyCaptionTemplate 的模板。

  2. 自定义 FormalImageCaption 样式。

  3. 请使用 getCaptionReporter 方法和 TemplateSrc 属性来调用您的模板。

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

版本历史记录

在 R2017b 中推出