Main Content

getLoggedSignals

Class: sltest.testmanager.LoggedSignalSet
Package: sltest.testmanager

Return logged signals contained in a set

Syntax

objs = getLoggedSignals(lgset)

Description

objs = getLoggedSignals(lgset) returns a vector of the sltest.testmanager.LoggedSignal objects contained in an sltest.testmanager.LoggedSignalSet object.

Input Arguments

expand all

Logged signal set object contained in a test case.

Examples

expand all

Open the model for this example.

sldemo_absbrake

Create test file, test suite, and test case structure.

tf = sltest.testmanager.TestFile('mytf');
ts = sltest.testmanager.TestSuite(tf,'myts');
tc = sltest.testmanager.TestCase(ts,'baseline','mytc');

Create a signal set.

lgset = addLoggedSignalSet(tc);

Select the Vehicle Speed block and enter gcb.

Use the returned path to create a Simulink.BlockPath object.

bPath = Simulink.BlockPath('sldemo_absbrake/Vehicle speed');
sig1 = lgset.addLoggedSignal(bPath,1);
sig2 = lgset.addLoggedSignal(bPath,2);

setProperty(tc,'Model','sldemo_absbrake');

Remove the signal and check that the signal has been removed.

remove(sig2);
sigs = lgset.getLoggedSignals
sigs = 
  LoggedSignal with properties:

           Name: 'Vehicle...'
         Source: 'sldemo_absbrake/Vehicle speed'
      PortIndex: 1
         Active: 1
    PlotIndices: []

Version History

Introduced in R2019a