MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看最新英文版本。
类: mlreportgen.report.Section 命名空间: mlreportgen.report
向该节添加内容
append(section,content)
append(section,content) 将指定的内容添加到指定的节。
section
content
全部展开
mlreportgen.report.Section
报告的节,指定为 mlreportgen.report.Section 对象。
要添加到节的内容,指定为以下值之一:
报告 API 报告器
DOM 对象
内置 MATLAB® 对象(大多数内置 MATLAB 对象可以添加到 Section 报告器)
Section
可以单独添加到节的对象元胞数组
此示例生成一份包含标题页和一章的报告。本章包含两节,每节包含一张图片。该示例使用 append 将内容添加到图像,将图像添加到章节,将章节添加到章节,并将章节和标题页添加到报告。
append
导入 DOM 和 API 包,这样您就不必使用长而完全限定的类名。
import mlreportgen.report.* import mlreportgen.dom.*
创建报告并为报告添加标题页。
rpt = Report("My Report","pdf"); append(rpt,TitlePage("Title","My Report"));
创建一个包含两节的章。为每一节添加一张图片。将章节添加到章中,将章添加到报告中。
ch = Chapter("Images"); sect1 = Section("Boeing 747"); append(sect1,Image("b747.jpg")); append(ch,sect1); sect2 = Section("Peppers"); append(sect2,Image("peppers.png")); append(ch,sect2); append(rpt,ch);
关闭并查看报告。
close(rpt); rptview(rpt);
在 R2020b 中推出
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处