slreportgen.report.MATLABSystem Class
Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter
Description
Use an object of the slreportgen.report.MATLABSystem
class to report on a
Simulink®
MATLAB System block.
By default, a MATLABSystem
reporter adds this information to a report:
Simulink MATLAB System block properties
A summary of the input and output arguments of the MATLAB System block
MATLAB System block source code
Note
To use a MATLABSystem
reporter in a report, you must create the report
using the slreportgen.report.Report
class.
The slreportgen.report.MATLABSystem
class is a handle
class.
Creation
Description
creates an empty reporter
= slreportgen.report.MATLABSystemMATLABSystem
reporter based on the default template. Use
the Object
property to specify the Simulink
MATLAB System block.
sets the reporter
= slreportgen.report.MATLABSystem(mlSysObj)Object
property to the MATLAB System block specified by
mlSysObj
.
sets
reporter
= MATLABSystem(Name=Value)MATLABSystem
reporter properties
using name-value pairs. You can specify multiple name-value pair arguments in any
order.
Properties
Object
— MATLAB® System block
[]
(default) | character vector | string scalar | function handle
MATLAB System to report, specified as one of these values:
Character vector or string scalar that contains the path to a MATLAB System block
Handle to a MATLAB System block
slreportgen.finder.BlockResult
objectslreportgen.finder.DiagramElementResult
object
Note
If you use a finder to find a MATLAB System block and add the
result directly to a report, the finder returns an
slreportgen.report.MATLABSystem
reporter instead of a Simulink
object property reporter.
IncludeObjectProperties
— Whether to include object properties
true (default) | false
Whether to include object properties, specified as a true
or
false
. If the value is true
, the report includes
a table of the properties of the MATLAB System block.
ObjectPropertiesReporter
— Object properties reporter
mlreportgen.report.BaseTable
object
Object properties reporter, specified as an mlreportgen.report.BaseTable
object. The MATLABSystem
reporter
uses this reporter to create a table of the properties of the MATLAB
System block.
To customize the appearance of the object property table and its title, customize
the default BaseTable
reporter or replace it with a custom version of the
BaseTable
reporter. To customize the title of the object property
table, specify the contents in the Title
property of the default or
replacement reporter. The content you specify is placed at the front of the default
title.
IncludeArgumentSummary
— Whether to Include an argument summary
true
(default) | false
Whether to Include an argument summary, specified as true
or
false
.
If true, the report includes a summary table for the input and outputs arguments of the MATLAB Systemblock. By default, the argument summary table includes the name, scope, port, data type, and size for all the input and output arguments.
Use the ArgumentSummaryProperties
property to customize the set
of properties to be reported in the summary table.
ArgumentSummaryProperties
— Argument properties to include
{'Name' 'Scope' 'Port' 'Data Type' 'Size' 'Complex' Fixed
Size'}
(default) | cell array of character vectors | string array
Argument properties to include, specified as a cell array of character vectors or a string array.
Specify any combination of these properties:
Name
Scope
Port
Data Type
Size
Complex
Fixed Size
ArgumentSummaryReporter
— Argument summary reporter
mlreportgen.report.BaseTable
object
Argument summary reporter, specified as a
mlreportgen.report.BaseTable
object. This property specifies the
reporter to be used to create the summary table for the input and output arguments of
the MATLAB System block. The default value of this property is a
mlreportgen.report.BaseTable
object. You can customize the appearance
of the table by customizing the default reporter or by replacing it with a customized
version of the BaseTable
reporter. Any content that you specify in the
Title
property of the default or the replacement reporter will
appear before the title in the generated report.
IncludeArgumentProperties
— Whether to Include details for each argument
false
(default) | true
Whether to include a property table with detailed information for each argument,
specified as true
or false
.
The argument summary table includes the name, scope, port, data type, and size for all the input and output arguments, as shown below:
Use the reporter's ArgumentSummaryProperties
property to
customize the set of properties to be reported in the summary table.
ArgumentPropertiesReporter
— Argument properties reporter
mlreportgen.report.BaseTable
object
Argument properties reporter, specified as an mlreportgen.report.BaseTable
object. This property specifies the reporter to
be used as the basis to create the property tables for the input and output arguments of
the MATLAB System block. The MATLABSystem
reporter creates
a copy of this reporter for each argument to be reported and uses the copy to report on
argument's properties. The default value of this property is a
mlreportgen.report.BaseTable
object. You can customize the appearance
of the table by customizing the default reporter or by replacing it with a customized
version of the BaseTable
reporter. Any content that you specify in the
Title
property of the default or the replacement reporter will
appear before the title in the generated report.
IncludeSourceCode
— Whether to include the source code
true
(default) | false
Whether to include the source code, specified as true
or
false
. If true
, the report includes the source
code of the MATLAB System.
SourceCodeReporter
— Source code reporter
mlreportgen.report.MATLABCode
object
Source code reporter, specified as a mlreportgen.report.MATLABCode
object. This is the reporter to be used to report and format the source code of the
MATLAB System. The default value of this property is an object of
MATLABCode
reporter type. To customize the code appearance, modify the
properties of the default MATLABCode
reporter or replace the reporter
with a custom reporter.
SourceCodeTitle
— Source code title
[]
(default) | character vector | string scalar | mlreportgen.dom.Paragraph
object
Source code title, specified as a character vector, string scalar, or an
mlreportgen.dom.Paragraph
object.
SourceCodeTitle
specifies a DOM Paragraph
object for this reporter to fill with the title content for the MATLAB System source code. The default value of this property is an empty
paragraph whose properties specify the appearance of the source code title. By default,
the MATLABSystem
reporter generates a title from the MATLAB
System block name and appends it to the paragraph. The generated title
consists of the MATLAB System block name followed by “Source Code”, for
example, "Analysis and Plot Source Code." You can customize the title appearance by
modifying the properties of the default paragraph object or by replacing it with another
paragraph object. The content that you add to the paragraph appears before the title in
the generated report.
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.MATLABSystem.createTemplate | Create copy of slreportgen.report.MATLABSystem reporter
template |
slreportgen.report.MATLABSystem.customizeReporter | Create subclass of slreportgen.report.MATLABSystem
class |
slreportgen.report.MATLABSystem.getClassFolder | Get location of folder that contains
slreportgen.report.MATLABSystem class definition file |
getImpl | Get implementation of reporter |
Examples
Report on a MATLAB System Block
Create a report from text file as a paragraph.
Import the report API namespace so that you do not have to use long fully qualified class names.
import slreportgen.report.*
Create a PFD report.
rpt = slreportgen.report.Report("output","pdf"); open(rpt);
Load the model.
model_name = "slrgex_slexLawOfLargeNumbersExample"; mlSysObj = strcat(model_name,"/Analysis and Plot"); load_system(model_name);
Create a chapter.
chapter = mlreportgen.report.Chapter(mlSysObj);
Create a MATLABSystem
reporter.
rptr = slreportgen.report.MATLABSystem(mlSysObj);
Add the MATLABSystem
reporter to the chapter and chapter to report
append(chapter,rptr); append(rpt,chapter);
Close and view the report.
close(rpt); close_system(model_name); rptview(rpt);
Version History
Introduced in R2023a
See Also
slreportgen.finder.BlockFinder
| slreportgen.finder.BlockResult
| slreportgen.finder.DiagramElementFinder
| slreportgen.finder.DiagramElementResult
| slreportgen.finder.StateflowDiagramElementFinder
| mlreportgen.report.BaseTable
| mlreportgen.dom.Paragraph
| MATLAB System | slreportgen.utils.isMATLABFunction
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 (한국어)