% Open the model
open_system('sltestExcelExample');
% 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
setProperty(tc,'Model','sltestExcelExample',...'SaveInputRunInTestResult',true);
% Add Excel data to Inputs section% Specify two sheets to add: Acceleration and Braking
input_path = fullfile(matlabroot,'toolbox','simulinktest',...'simulinktestdemos','sltestExampleInputs.xlsx');
input = addInput(tc,input_path,'Sheets',["Acceleration","Braking"]);
% Map the input signal for the sheets by block name
map(input(1),0);
map(input(2),0);
% 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;