Main Content

getLoggedSignals

Class: sltest.testmanager.LoggedSignalSet
Namespace: 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('rmSigs_testfile');
ts = sltest.testmanager.TestSuite(tf,'rmSigs_testsuite');
tc = sltest.testmanager.TestCase(ts,'baseline','rmsigs_testcase');

Create a signal set.

lgset = addLoggedSignalSet(tc);

Open the Vehicle Dynamics block and then the Vehicle block. Select the Vehicle Speed block. Then, enter gcb to obtain the full block path. Use the returned path to create a Simulink.BlockPath object.

blkpath=['sldemo_absbrake/'...
    'Vehicle Dynamics/Vehicle  /Vehicle Speed'];
bPath = Simulink.BlockPath(blkpath);
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 Velocity'
         Source: 'sldemo_absbrake/Vehicle Dynamics/Vehicle  /Vehicle Speed'
      PortIndex: 1
         Active: 1
    PlotIndices: []

Version History

Introduced in R2019a