Main Content

mlreportgen.report.SummaryTable Class

Namespace: mlreportgen.report

Summarize finder results

Since R2022a

Description

Use an instance of mlreportgen.report.SummaryTable class to generate a table that summarizes the results of a search by a MATLAB® Report Generator™ finder object. The table lists the key properties of each finder result object. For more information, see finder result class.

The mlreportgen.report.SummaryTable class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

summaryTableRptr = mlreportgen.report.SummaryTable creates an empty summary table reporter. Use the FinderResults (Simulink Report Generator) property to specify the results to summarize.

Note

Adding an empty MATLAB summary table reporter to a report causes an error.

summaryTableRptr = mlreportgen.report.SummaryTable(finderResults) creates a summary table reporter for the result objects in the array finderResults and sets the FinderResults property to finderResults.

example

summaryTableRptr = mlreportgen.report.SummaryTable(Name=Value) sets properties by using name-value arguments. Specify multiple name-value arguments in any order.

Properties

expand all

Finder result objects to report, specified as an array of objects of a finder result class such as mlreportgen.finder.MATLABVariableResult or mlreportgen.finder.AxesResult.

Attributes:

GetAccess
public
SetAccess
public

Title for the summary table, specified as a string, character vector, or a DOM object. By default, this property is empty and the reporter creates the table title by using the getDefaultSummaryTableTitle method for the finder result object specified by finderResults.

Specifying this property as a character vector or string scalar creates an mlreportgen.dom.Paragraph object with Style property set to 'SummaryTableTitleParagraph'.

Attributes:

GetAccess
public
SetAccess
public

Properties of the result class to report on, specified as an array of string scalars or cell array of character vectors.

If Properties is empty, the reporter determines which finder result object properties to report by using the getDefaultSummaryProperties method of the finder result object specified by finderResults.

The summary table contains a row for each result whose entries contain properties of the found object. By default, the reported properties depend on the result object type. Use the summary table reporters Properties properties to customize the set of properties to report on.

Use the getPropertyValues method of the finder result object specified by finderResults to identify the properties you can add to the summary table.

Attributes:

GetAccess
public
SetAccess
public

Whether to link the Title property of each object in the summary table to link to the corresponding reporter object, specified as true or false.

Attributes:

GetAccess
public
SetAccess
public

Whether to include columns for empty finder result object properties in the summary tables, specified as false or true.

Attributes:

GetAccess
public
SetAccess
public

Table reporter formatter type, specified as an mlreportgen.report.BaseTable object. Customize the appearance of the summary table by customizing the default reporter or by replacing it with a customized BaseTable reporter.

Attributes:

GetAccess
public
SetAccess
public

Methods

expand all

Examples

collapse all

This example shows how to add a summary table for the results of an mlreportgen.report.AxesFinder object.

Create a PDF report.

import mlreportgen.report.*
import mlreportgen.finder.*

rpt = mlreportgen.report.Report("Summary Table Results","pdf");
add(rpt,TitlePage("Title",sprintf("Summary Table for Axes Finder Results"),"Author",""));

Create a figure handle and the axes to report.

figH = figure;
ax1 = subplot(3,2,2);
x = linspace(0,20);
y1 = cos(x);
plot(x,y1);
ax1.Title = title("Example Plot 1");

ax2 = subplot(3,2,4);
y2 = sin(tan(x).*x);
plot(x,y2);
ax2.Title = title("Example Plot 2");

Create an AxesFinder object to find the axes.

finderObj = mlreportgen.finder.AxesFinder(figH);
results = find(finderObj);

Pass the results of the find method to a SummaryTable reporter.

rptr = mlreportgen.report.SummaryTable(results);
rptr.ShowEmptyColumns = true;
append(rpt,rptr);
close(rpt);
rptview(rpt);

More About

expand all

Version History

Introduced in R2022a