Main Content


Class: sltest.testmanager.TestCaseResult, sltest.testmanager.TestIterationResult
Namespace: 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

Load the Example Model and Create a New Test File

tf = sltest.testmanager.TestFile('Input Run Test File');

Get the Test Suite and Test Case Objects

ts = getTestSuites(tf);
tc = getTestCases(ts);

Add the Model as the System Under Test and Save the Input Run


Add Excel® Data to Inputs Section and Specify Sheets to Add

excelfile = 'sltestExampleInputs.xlsx';
input = addInput(tc,excelfile,'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 Get the Test Case and Iteration Results

resultsObj = run(tc);
tcr = getTestCaseResults(resultsObj);
tir = tcr.getIterationResults;

Get the Inputs From the Simulation Run

inrun = tir(1).getInputRuns;

Version History

Introduced in R2017a