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 a model and create a signal set.

openExample('sldemo_absbrake')

% Create test case
tf = sltest.testmanager.TestFile(strcat(pwd,'\mytf.mldatx'));
ts = sltest.testmanager.TestSuite(tf,'myts');
tc = sltest.testmanager.TestCase(ts,'baseline','mytc');

% Create signal set
mylgset = tc.addLoggedSignalSet;

Select the Vehicle Speed block and enter gcb. Use the returned path to create a Simulink.BlockPath object.

% Add signals to set
bPath = Simulink.BlockPath('sldemo_absbrake/Vehicle speed');
sig1 = mylgset.addLoggedSignal(bPath,1);
sig2 = mylgset.addLoggedSignal(bPath,2);

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

% Remove signal
remove(sig2);

% Check that signal is removed
sigs = mylgset.getLoggedSignals

Version History

Introduced in R2019a