slreportgen.report.ModelConfiguration Class
Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter
Description
Use an object of the slreportgen.report.ModelConfiguration
class to report
on the active configuration set of a model.
Note
To use an slreportgen.report.ModelConfiguration
reporter in a report,
you must create the report using the slreportgen.report.Report
class or
subclass.
The slreportgen.report.ModelConfiguration
class is a handle
class.
Creation
Description
creates an empty reporter
= slreportgen.report.ModelConfigurationModelConfiguration
reporter object based on the default
template. You must specify a model for which to report the active configuration set by
setting the Model
property. Use other properties to specify report options.
creates a reporter
= slreportgen.report.ModelConfiguration(model
)ModelConfiguration
reporter object and sets the Model
property to the specified model.
sets the reporter properties using name-value pairs. You can specify multiple name-value
pair arguments in any order.reporter
= slreportgen.report.ModelConfiguration(Name=Value
)
Properties
Model
— Name or handle of model
[]
(default) | string scalar | character vector | handle
Name or handle of open or loaded Simulink® model, specified as a string scalar, character vector, or handle.
Title
— Configuration set title
[]
(default) | character vector | string scalar | mlreportgen.dom.Text
object | mlreportgen.dom.InternalLink
object | mlreportgen.dom.ExternalLink
object
Configuration set title, specified as a character vector, string scalar, mlreportgen.dom.Text
object, mlreportgen.dom.InternalLink
object, or mlreportgen.dom.ExternalLink
object.
If the FormatPolicy property is set to "Inline Text"
and the
Title
property is set to:
A DOM object, the formatting specified by the DOM object is ignored
An
mlreportgen.dom.InternalLink
ormlreportgen.dom.ExternalLink
object, the link text is used for the title, but the title is not a link
In both cases, to format the title, use the TextFormatter property of this ModelConfiguration
reporter.
If you do not specify a title, the title is the model name followed by
Configuration Set
. For example:
sf_car Configuration Set
FormatPolicy
— Format for reporting configuration set
"Auto"
(default) | "Table"
| "Paragraph"
| "Inline Text"
Format for reporting the configuration set, specified as one of these strings or character vectors:
"Auto"
— Formats the configuration set, components, and property values as a table or a paragraph, depending on the data type.Data types formatted as a table include:
Cell array
Logical array
Numeric array
MATLAB® table
Simulink object
Stateflow® object
Graphics object
MATLAB structure or structure array
MATLAB object or object array
Data types formatted as a paragraph include:
Cell vector
Logical scalar or vector
Numeric scalar or vector
Character or character array
String
MATLAB structure vector
MATLAB object vector
Because the configuration set and components are objects, they are formatted as tables. The property values are formatted according to the data types of the values.
"Table"
— Formats the values in a table. Data types that by default appear as paragraphs are formatted instead as table entries. Data types that are hierarchically structured objects, such as MATLAB structures, MATLAB objects, Simulink objects, Stateflow objects, or graphics objects, can have properties that are themselves objects. In these cases, the hierarchy is flattened and the property value is a hyperlink to a table of the field or object properties. The field or property table links back to the original table."Paragraph"
— Generates a description of the configuration set as paragraphs. For example:"Inline Text"
— Generates a description of the configuration set in line with the surrounding text. For example:
TableReporter
— Table formatter
mlreportgen.report.BaseTable
object
Table formatter for the tables that the ModelConfiguration
reporter
generates, specified as an mlreportgen.report.BaseTable
object. The default value of this property is a
BaseTable
object with the TableStyleName
property
set to the ModelConfigurationTable
style, which is defined in the
default template for a ModelConfiguration
reporter. To customize the
appearance of the table, modify the properties of the default BaseTable
object or replace the object with your own BaseTable
object.
If you add content to the
Title
property, the content appears in front of the table title
in the generated report.
ParagraphFormatter
— Paragraph formatter
mlreportgen.dom.Paragraph
object
Paragraph formatter for any model configuration content that is generated as a
paragraph, specified as an mlreportgen.dom.Paragraph
object. The
default value of this property is a Paragraph
object with the
StyleName
property set to the
ModelConfigurationParagraph
style, which is defined in the default
template for a ModelConfiguration
reporter. To customize the appearance
of the paragraph, modify the properties of the default Paragraph
object
or replace the object with your own Paragraph
object. If you add content to the paragraph object, the
content appears in front of the model configuration content in the generated
report.
TextFormatter
— Text formatter
mlreportgen.dom.Text
object
Text formatter for any model configuration content that is generated as inline text,
specified as an mlreportgen.dom.Text
object. By default,
the value of this property is an empty Text
object. To customize the
appearance of the text, modify the properties of the default
mlreportgen.dom.Text
object or replace the object with a customized
mlreportgen.dom.Text
object. If
you add content to the Text
object, the content appears in front of the
model configuration content in the generated report.
MaxCols
— Maximum number of columns in value tables
32 (default) | positive integer
Maximum number of table columns in value tables, specified as a positive integer. If
a property value is reported using a table and the number of columns is greater than the
value of the MaxCols
property, the table is sliced vertically.
Slicing divides the table into multiple tables.
DepthLimit
— Maximum number of nested levels to report
10
(default) | nonnegative integer
Maximum number of nested levels in the structured object hierarchy to report,
specified as a nonnegative integer. The top level of the hierarchy is the configuration
set object (Simulink.ConfigSet
). Levels less than or
equal to the value of DepthLimit
are flattened into a sequence of
interlinked tables. Levels greater than the depth limit are not reported. If you set the
DepthLimit
property to 0
, hierarchically
structured types are not expanded.
ObjectLimit
— Maximum number of nested objects to report
200
(default) | positive integer
Maximum number of objects in an object hierarchy to report, specified as a positive integer.
IncludeTitle
— Whether to include the configuration set title
true
(default) | false
Whether to include the configuration set title, specified as true
or false
.
When IncludeTitle
is true
, the configuration
set title (the content of the Title
property) is included in the:
Title of the configuration set property table when the
FormatPolicy
is"Auto"
or"Table"
The content generated when the
FormatPolicy
is"Inline Text"
or"Paragraph"
The configuration set title is always included in the title for the paragraph or
table that contains the configuration set components, regardless of the value of the
IncludeTitle
property.
ShowDataType
— Whether a title includes data type
false
(default) | true
Whether a title includes the data type of the value that the title describes,
specified as true
or false
.
Data Types: logical
ShowEmptyValues
— Whether to show configuration properties that have empty values
true
(default) | false
Whether to show configuration set or component properties that have empty values,
specified as a true
or false
.
Data Types: logical
ShowDefaultValues
— Whether to show configuration properties that use default values
true
(default) | false
Whether to show configuration set or component properties that use the default
values, specified as true
or false
.
Data Types: logical
PropertyFilterFcn
— Function or expression to filter configuration properties from a report
[]
(default) | function handle | string scalar | character vector
Function or expression to filter configuration set and component object properties
from a report, specified as a function handle, string scalar, or character vector.
Specify a function as a function handle. Specify an expression as a string scalar or
character vector. If PropertyFilterFcn
is empty, all properties are
included in the report.
If you provide a function handle, the associated function must:
Take these arguments:
variableName
— Name of the variable being reportedvariableObject
— The variable being reportedpropertyName
— Name of the property of the variable being reported
Return
true
to filter the specified property from the report, orfalse
to include the property in the report.
Run the following command to access the supporting files used in this example.
openExample('rptgenext/SimulinkReportGeneratorFilesExample');
For example, this code uses the PropertyFilterFcn
property to
prevent the display of the Name
and Description
properties:
import slreportgen.report.* rpt = slreportgen.report.Report("MyReport","pdf"); open(rpt); model = "sf_car"; load_system(model); reporter = ModelConfiguration(model); filterFcnHandle = @(variableName,variableObject,propertyName) ... (propertyName == "Name") || ... (propertyName == "Description"); reporter.PropertyFilterFcn = filterFcnHandle; append(rpt,reporter); close(rpt); rptview(rpt);
If you provide a string scalar or a character vector, it must contain an expression. The expression:
Can use the variables
variableName
,variableObject
, andpropertyName
Must set the variable
isFiltered
totrue
to filter the specified property from the report, orfalse
to include the property in the report
For example, this code uses the PropertyFilterFcn
property to
prevent the display of the Name
and Description
properties:
import slreportgen.report.* rpt = slreportgen.report.Report("MyReport","pdf"); open(rpt); model = "sf_car"; load_system(model); reporter = ModelConfiguration(model); filterStr = "isFiltered = " +... "strcmp(propertyName,'Name')||strcmp(propertyName,'Description');"; reporter.PropertyFilterFcn = filterStr; append(rpt,reporter); close(rpt); rptview(rpt);
NumericFormat
— Format or precision used to display noninteger numeric values
[]
(default) | string scalar | character vector | positive integer
Format or precision used to display noninteger numeric values, specified as a string scalar, character vector, or positive integer.
Specify the format as a string scalar or a character vector. See the formatSpec
argument on
the sprintf
reference page.
Specify the precision as a positive integer. See the precision
argument on the
num2str
reference page.
Example: "%.2f"
displays double values with two digits to the
right of the decimal place.
Example: 2
displays a maximum number of two significant
digits.
TemplateSrc
— Source of template for this reporter
character vector | string scalar | reporter or report | DOM document or document part
Source of the template for this reporter, specified in one of these ways:
Character vector or string scalar that specifies the path of the file that contains the template for this reporter
Reporter or report whose template is used for this reporter or whose template library contains the template for this reporter
Document Object Model (DOM) document or document part whose template is used for this reporter or whose template library contains the template for this reporter
The specified template must be the same type as the report to which you
append this reporter. For example, for a Microsoft® Word report, TemplateSrc
must be a Word reporter template.
If the TemplateSrc
property is empty, this reporter uses the
default reporter template for the output type of the report.
TemplateName
— Name of template for this reporter
character vector | string scalar
Name of the template for this reporter, specified as a character vector or string scalar.
The template for this reporter must be in the template library of the template specified by
the TemplateSrc
property of this reporter.
Data Types: char
| string
LinkTarget
— Hyperlink target for this reporter
[]
(default) | character vector | string scalar | mlreportgen.dom.LinkTarget
object
Hyperlink target for this reporter, specified as a character vector or string scalar
that specifies the link target ID, or an mlreportgen.dom.LinkTarget
object. A character vector or string scalar
value converts to a LinkTarget
object. The link target immediately
precedes the content of this reporter in the output report.
Methods
Public Methods
slreportgen.report.ModelConfiguration.createTemplate | Create model configuration reporter template |
slreportgen.report.ModelConfiguration.customizeReporter | Create custom model configuration reporter class |
slreportgen.report.ModelConfiguration.getClassFolder | Get location of model configuration reporter class definition file |
copy | Create copy of a Simulink reporter object and make deep copies of certain property values |
getConfigSet | Get active configuration set from model configuration reporter |
getImpl | Get implementation of reporter |
Examples
Report Active Model Configuration Set
Use an object of the slreportgen.report.ModelConfiguration
class to report on the active model configuration set.
Import the MATLAB Report and Simulink Report API packages so that you do not have to use long, fully qualified class names.
import mlreportgen.report.* import slreportgen.report.*
Create a Simulink report.
rpt = slreportgen.report.Report("MyReport","pdf"); open(rpt);
Create a chapter for the active model configuration set.
chapter = Chapter();
chapter.Title = "Active Model Configuration Set";
Load a model.
model = "sf_car";
load_system(model);
Create an slreportgen.report.ModelConfiguration
object to report on the active configuration set of the model.
reporter = ModelConfiguration(model);
Append the reporter to the chapter and chapter to the report.
append(chapter,reporter); append(rpt,chapter);
Close and view the report.
close(rpt); rptview(rpt);
Version History
Introduced in R2020b
MATLAB Command
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)