Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Design Verifier   

sldvruntest - Simulate model using test case

Syntax

data = sldvruntest(model, sldvDataFile, testIdx)
data = sldvruntest(model, sldvDataFile)
[data, cvdo] = sldvruntest(model, sldvDataFile, testIdx, withCoverage)
[data, cvdo] = sldvruntest(model, sldvDataFile, [], withCoverage)
[data, cvdo] = sldvruntest(model, sldvDataFile, testIdx, cvt)
[data, cvdo] = sldvruntest(model, sldvDataFile, [], cvt)
[data, cvdo] = sldvruntest(model, sldvDataFile, testIdx, withCoverage, outputFormat)

Description

data = sldvruntest(model, sldvDataFile, testIdx) simulates model using input signals associated with a single test case. testIdx specifies the index of the test case in sldvDataFile. data is a structure whose fields contain the simulation results.

data = sldvruntest(model, sldvDataFile) simulates model using all test cases in the sldvDataFile MAT-file. For each test case, the software uses the stop time associated with that particular test case.

[data, cvdo] = sldvruntest(model, sldvDataFile, testIdx, withCoverage) simulates model using the test case that testIdx indexes in sldvDataFile. The Simulink Verification and Validation software collects model coverage information during the simulation, which the function returns in the cvdata object cvdo.

[data, cvdo] = sldvruntest(model, sldvDataFile, [], withCoverage) simulates model using all test cases in sldvDataFile. If you omit the testIdx argument, sldvruntest uses all the test cases in the simulation. The Simulink Verification and Validation software collects model coverage information during the simulation, which the function returns in the cvdata object cvdo.

[data, cvdo] = sldvruntest(model, sldvDataFile, testIdx, cvt) runs a simulation using the test case that testIdx indexes in the sldvDataFile MAT-file, and records coverage data. The coverage tool uses the settings in the cvtest object cvt.

[data, cvdo] = sldvruntest(model, sldvDataFile, [], cvt) runs simulations for each test case and records the cumulative coverage. The coverage tool uses the settings in cvt.

[data, cvdo] = sldvruntest(model, sldvDataFile, testIdx, withCoverage, outputFormat) stores the output values of the model in model in the structure data.

Inputs

cvt

cvtest object

model

Handle to a Simulink model

Default: ''

sldvDataFile

Name of the data file that contains the analysis results

Default: ''

testIdx

Test case index in the data file

Default: []

withCoverage

If true, the Simulink Verification and Validation software collects model coverage information during the simulation in cvdo.

Default: 0

outputFormat

Specifies format of output values.

'Timeseries' (default)sldvruntest stores the output values in the Timeseries format.
'StructureWithTime'sldvruntest stores the output values in the Structure with time format, if the model output signals do not include bus signals.

Outputs

cvdo

cvdata object that contains the model coverage information collected during the simulation

data

A structure whose fields contain the simulation results.

TSimulation time vector
XSimulation state matrix
YSimulation output captured in time-series objects. If the Outport block specifies a bus object, output captured in time-series array objects.

Examples

Run a simulation, using data from any test case in the test suite, to check for full coverage of the model sldvdemo_cruise_control:

opts = sldvoptions;
opts.Mode = 'TestGeneration';
opts.ModelCoverageObjectives = 'MCDC';
opts.SaveHarnessModel = 'off';
opts.SaveReport = 'off';
open_system 'sldvdemo_cruise_control';
[ status, files ] = sldvrun('sldvdemo_cruise_control', opts);
[ outData, initialCov ] = sldvruntest('sldvdemo_cruise_control',...
    files.DataFile, [], true);
cvhtml('Initial coverage', initialCov);

See Also

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS