Main Content

slreportgen.finder.SignalResult class

Package: slreportgen.finder

Signal search result object

Description

An object of the slreportgen.finder.SignalResult class represents a result of a search for the signals used by a model or block. You can append a SignalResult object directly to a report. Alternatively, you can use the getReporter method to access the slreportgen.report.Signal reporter for the result and then customize the reporter and append it to the report.

The slreportgen.finder.SignalResult class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

You do not create an slreportgen.finder.SignalResult object explicitly. The slreportgen.finder.SignalFinder find and next methods create an slreportgen.finder.SignalResult object for each signal that is found.

Properties

expand all

Block output port that represents the found signal, specified as a handle. This property is read-only.

Name of the found signal, specified as a string scalar. This property is read-only.

Name of the block that is the source of the found signal, specified as a string scalar. This property is read-only.

Number of the output port that represents the found signal, specified as an integer. This property is read-only.

Name of model or block that uses this signal, specified as a string scalar. The value of this property corresponds to the value of the Container property of the slreportgen.finder.SignalFinder object used to find this signal. This property is read-only.

Relationship of the found signal to the container model or block, specified as "Input", "Output", "Internal", "Control", or "State". The container model or block is specified by the RelatedObject property.

Additional information to save with this result, specified as any value.

Methods

expand all

Examples

collapse all

Use the getReporter method of an slreportgen.finder.SignalResult object to access the signal reporter for the result. Then, customize the reporter by setting its properties.

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.*

Create a Simulink report.

rpt = slreportgen.report.Report("MySignalReport","pdf");

Create a chapter for the signal information.

chapter = mlreportgen.report.Chapter();
chapter.Title = "Signals";

Load a model.

model_name = "vdp";
load_system(model_name);

Create a signal finder.

finder = slreportgen.finder.SignalFinder(model_name);

Find the signals. For each found signal, get the reporter, specify that you want to report empty property values, and add the reporter to the chapter.

while hasNext(finder)
    result = next(finder);
    
    reporter = getReporter(result);
    reporter.ShowEmptyValues = true;
 
    add(chapter,reporter);
end

Add the chapter to the report.

add(rpt,chapter);

Close and view the report.

close(rpt);
rptview(rpt);
Introduced in R2021a