Main Content

getSignalsOfInterest

Class: coder.codedescriptor.CodeDescriptor
Namespace: coder.codedescriptor

Return description of signals of interest

Since R2025a

Syntax

signals = getSignalsOfInterest(selector)
signals = getSignalsOfInterest(selector1,selector2,...)

Description

signals = getSignalsOfInterest(selector) returns a list of SignalOfInterest objects describing signals that match the given selector selector.

signals = getSignalsOfInterest(selector1,selector2,...) returns a list of SignalOfInterest objects describing signals that match any of the given selectors.

Input Arguments

expand all

Selector matching the type of signal for which you want to retrieve information in the generated code, specified as a character vector.

  • 'TestPoint' — Return a description of test points in the generated code.

  • 'DataLogging' — Return a description of logged signals in the generated code.

Data Types: char

Output Arguments

expand all

List of signals of interest in the generated code, returned as a vector of coder.descriptor.SignalOfInterest objects.

Examples

expand all

  1. Open the model.

    openExample('CustomCodeComments')
  2. Create a test point for the output of the Stateflow® block.

    portHandles = get_param('CustomCodeComments/Stateflow','portHandles');
    outportHandle = portHandles.Outport;
    set_param(outportHandle,'TestPoint','on')

  3. Build the model.

    slbuild('CustomCodeComments')

  4. Create a coder.codedescriptor.CodeDescriptor object for the required model.

    codeDescObj = coder.getCodeDescriptor('CustomCodeComments')
    

  5. Retrieve information about the code representation of the test point by calling getSignalsOfInterest with the appropriate selector.

    signals = codeDescObj.getSignalsOfInterest('TestPoint')
    signals = 
    
      SignalOfInterest with properties:
        DataInterface: [1×1 coder.descriptor.DataInterface]

Version History

Introduced in R2025a