Main Content

remove

Class: sltest.testmanager.LoggedSignal
Namespace: sltest.testmanager

Remove a logged signal

Syntax

remove(obj)

Description

remove(obj) removes an sltest.testmanager.LoggedSignal object from an sltest.testmanager.LoggedSignalSet object and invalidates the LoggedSignal object.

Input Arguments

expand all

Logged signal object contained in a logged signal set.

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