Main Content

sldvsimdata

Get simulation data in Dataset format

Description

[simData,params] = sldvsimdata(dataFile) returns Simulink.SimulationData.Dataset object simData, containing simulation data, and structure array params, containing parameter values, from Simulink® Design Verifier™ data file dataFile. The elements of simData and params correspond to each test case or counterexample in dataFile.

[simData,params] = sldvsimdata(dataFile,index) returns Simulink.SimulationData.Dataset object simData, containing simulation data, and structure array params, containing parameter values, for the test case or counterexample represented by integer index in Simulink Design Verifier data file dataFile.

[simData,params] = sldvsimdata(data) returns Simulink.SimulationData.Dataset object simData, containing simulation data, and structure array params, containing parameter values, from Simulink Design Verifier data variable data.

example

[simData,params] = sldvsimdata(data,index) returns Simulink.SimulationData.Dataset object simData, containing simulation data, and structure array params, containing parameter values, for the test case or counterexample represented by integer index in the Simulink Design Verifier data variable data.

Examples

collapse all

Generate test cases for the sldvdemo_cruise_control model. Then, report coverage by using sldvsimdata for test case 1.

Open the sldvdemo_cruise_control example model.

model = 'sldvdemo_cruise_control';
open_system('sldvdemo_cruise_control');

Analyze the model and generate test cases by using sldvrun.

[~,files] = sldvrun(model);
s = load(files.DataFile);

Generate a Simulink.SimulationData.Dataset object for test case 1 from the Simulink Design Verifier data variable s.

simData = sldvsimdata(s.sldvData,1);

Simulate and generate model coverage report for test objects.

cvdata = cvsim(model, 10, [], simData);
 cvhtml('Test Coverage', cvdata);

Input Arguments

collapse all

Simulink Design Verifier data file. For more information, see Simulink Design Verifier Data Files.

Simulink Design Verifier data variable.

An integer that specifies the index of a test case or counterexample in a data file.

Output Arguments

collapse all

Simulation data, returned as Simulink.SimulationData.Dataset object.

Model parameters, returned as a structure array.

Introduced in R2014b