slreportgen.report.Signal Class
Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter
Signal reporter
Description
Use an object of the slreportgen.report.Signal class to report the
properties of a signal.
Signals are the outputs of dynamic systems that are represented by blocks in a Simulink diagram and by the diagram itself. See Signal Basics.
Note
To use a Signal object in a report, you must create the report using the
slreportgen.report.Report class or subclass.
The slreportgen.report.Signal class is a handle class.
Creation
Description
creates
an reporter = slreportgen.report.Signalslreportgen.report.Signal object with default property values. You must
specify the signal to report by setting the Object
property. Use other properties to customize the information reported and the formatting of
the information.
sets the reporter = slreportgen.report.Signal(PropertyName=Value)Signal object properties
using name-value arguments. You can specify multiple name-value arguments in any
order.
Properties
Block output port that represents the signal to report, specified as a handle. The signal reporter reports information about the properties of the output port and the properties of the line connected to the port.
Whether to report information about the Simulink.Signal object for this signal, specified as a logical 1
(true) or 0 (false). When you
specify:
1(true) — The signal reporter includes information about theSimulink.Signalobject that specifies the attributes of the signal. The properties of theSimulink.Signalobject are reported using anmlreportgen.report.MATLABVariablereporter. Use theMATLABVariableReporterproperty of this signal reporter to customize the appearance of the signal object information. If the signal is not associated with a signal object, nothing is reported.0(false) — Do not report information about theSimulink.Signalobject.
Reporter for the Simulink.Signal object that defines the
signal being reported, specified as an mlreportgen.report.MATLABVariable object. The default value is an empty
MATLABVariable reporter with the DepthLimit
property set to 0. The default reporter reports information about the
Simulink.Signal object in a single table. To customize the appearance
of the reported information, modify the properties of the default
MATLABVariable reporter or replace the reporter with a customized
MATLABVariable reporter. For example, the following code uses the
PropertyFilterFcn property of the MATLABVariable
reporter to display only specific properties of the Simulink.Signal
object:
filterFcnHandle = @(variableName, variableObject, propertyName) ... ~ismember(propertyName, ["Description", "DataType", "Unit"]); signalRptr.MATLABVariableReporter.PropertyFilterFcn = filterFcnHandle;
CoderInfo property,
have values that are also objects with properties. To display the properties of
properties in separate tables, set the DepthLimit property of the
MATLABVariableReporter to an integer that is greater than 0. For
example: signalRptr.MATLABVariableReporter.DepthLimit = 10;
Signal properties table formatter, specified as an mlreportgen.report.BaseTable object. The default value of this property is a
BaseTable object with the TableStyleName property
set to the SignalTable style, which is defined in the default
template for a Signal 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 of the BaseTable object, the
content appears in front of the table title in the generated report.
Choice to show properties with empty values.
Whether to show properties with empty values, specified as a logical 1
(true) or 0 (false). When you
specify:
1(true) — Show properties with empty values in the table.0(false) — Omit properties with empty values from the table.
Attributes:
GetAccess | public |
SetAccess | public |
Data Types: logical
Signal properties to report, specified as a string array or a cell array of character vectors. Specify any combination of these properties:
NameDescriptionSourceDestinationNonvirtualDestinationDataTypeComplexityDimensionsMinMaxSampleTime
Data Types: char | string | cell
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 this reporter uses or whose template library contains the template for this reporter
Document Object Model (DOM) document or document part whose template this reporter uses 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.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Dependent | true |
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.
Attributes:
GetAccess | public |
SetAccess | public |
Data Types: char | string
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.
Attributes:
GetAccess | public |
SetAccess | public |
Methods
| Method | Purpose |
|---|---|
slreportgen.report.Signal.createTemplate |
Create reporter template
Input Arguments
Return Values
For more information, see the method
for the |
slreportgen.report.Signal.customizeReporter |
Create reporter from
Input Arguments
Return Values
For more information, see the method
for the |
slreportgen.report.Signal.getClassFolder |
Get location of folder that contains
Return Values
For more information, see the method
for the |
copy |
Create copy of reporter object and make deep copies of property values
Input Arguments
Return Values
For more information, see the method
for the |
getImpl |
Get implementation of reporter
Note You cannot add content to the reporter after calling this method. Input Arguments
Return Values
For more information, see the method
for the |
Examples
Use an slreportgen.report.Signal object to include information about a signal in a report.
Import the MATLAB and Simulink Report API packages so that you do not have to use long, fully qualified class names.
import mlreportgen.report.* import slreportgen.report.*
Load the vdp model.
model_name = "vdp";
load_system(model_name);Create a Simulink report.
rpt = slreportgen.report.Report("signal_example","pdf");
Add a diagram of the model to the report.
append(rpt,slreportgen.report.Diagram(model_name));
Get the port handle for the signal that you want to report.
ph = get_param("vdp/x1","PortHandles"); port = ph.Outport;
Create a chapter for the signal information.
ch = Chapter("x1");Create a Signal reporter for the signal and append the reporter to the chapter.
signalRptr = slreportgen.report.Signal(port); append(ch,signalRptr);
Add the chapter to the report. Close and view the report.
append(rpt,ch); close(rpt); rptview(rpt);
Version History
Introduced in R2021a
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)