Main Content


Class: sltest.testmanager.TestCaseResult, sltest.testmanager.TestIterationResult
Package: sltest.testmanager

Get inputs from simulations captured with the test result


runArray = getInputRuns(result)


runArray = getInputRuns(result) gets the simulation inputs from the test result.

Input Arguments

expand all

Test results to get simulation input results from, specified as a sltest.testmanager.TestCaseResult or sltest.testmanager.TestIterationResult object.

Output Arguments

expand all

Simulation run input results, returned as a Simulink.sdi.Run object array.


expand all

% Open the model

% Create test file and get test suite and test case objects
tf = sltest.testmanager.TestFile('Input Run Test File');
ts = getTestSuites(tf);
tc = getTestCases(ts);

% Add the model as the system under test, specify to save input runs

% Add Excel data to Inputs section
% Specify two sheets to add: Acceleration and Braking
input_path = fullfile(matlabroot,'toolbox','simulinktest',...
input = addInput(tc,input_path,'Sheets',["Acceleration","Braking"]);

% Map the input signal for the sheets by block name

% Capture the baseline criteria
baseline = captureBaselineCriteria(tc,'baseline_API.mat',true);

% Run the test case and return the results data
resultsObj = run(tc);

% Get test case result and iteration result
tcr = getTestCaseResults(resultsObj);
tir = tcr.getIterationResults;

% Get inputs from simulation run
inrun = tir(1).getInputRuns;
Introduced in R2017a