Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Verification and Validation   

cvsim - Simulate and return model coverage results for test objects

Syntax

cvdo = cvsim(cvto)
[cvdo,t,x,y] = cvsim(cvto)
[cvdo,t,x,y] = cvsim(cvto, timespan, options)
[cvdo,t,x,y] = cvsim(cvto, label, setupcmd)
[cvdo1, cvdo2, ...] = cvsim(cvto1, cvto2, ...)

Description

cvdo = cvsim(cvto) simulates the cvtest object cvto by starting a simulation run for the corresponding model. The software returns the results in the cvdata object cvdo. However, when recording coverage for multiple models in a hierarchy, cvsim returns its results in a cv.cvdatagroup object.

[cvdo,t,x,y] = cvsim(cvto) returns the time vector t, matrix of state values x, and matrix of output values y from the simulation.

[cvdo,t,x,y] = cvsim(cvto, timespan, options) returns the time vector t, matrix of state values x, and matrix of output values y from the simulation, and overrides default simulation values with the values for timespan and options.

[cvdo,t,x,y] = cvsim(cvto, label, setupcmd) creates the cvtest object cvto and simulates it in one command. The arguments label and setupcmd are passed directly to the cvtest function, which creates the cvtest object cvto.

[cvdo1, cvdo2, ...] = cvsim(cvto1, cvto2, ...) executes the cvtest objects cvto1, cvto2, ... and returns the results in the set of cvdata objects cvdo1, cvdo2, ....

You do not have to enable model coverage reporting for the model to use the cvsim command.

Inputs

cvto

cvtest object

label

Label for test object (passed to cvtest)

Default: []

options

Optional simulation parameters specified as a structure created by the simset command.

setupcmd

Setup command used to create test object (passed to cvtest)

Default: []

timespan

Simulation start and stop time:

tFinal

To specify the stop time. The start time is 0.

[tStart tFinal]

To specify the start and stop times.

[tStart OutputTimes tFinal]

To specify the start and stop times and time points to be returned in t.

Generally, t includes more time points. OutputTimes is equivalent to specifying Configuration Parameters > Data Import/Export > Output options > Produce specified output only.

Outputs

cvdo

cvdata object

t

The simulation's time vector

x

The simulation's state matrix consisting of continuous states followed by discrete states

y

The simulation's output matrix. Each column contains the output of a root-level Outport block, in port number order. If any Outport block has a vector input, its output takes the appropriate number of columns.

Examples

Simulate the slvnvdemo_cv_small_controller model, get the test data, and simulate the model with that test data. cvsim returns the time vector, matrix of state values, and matrix of output values:

model = 'slvnvdemo_cv_small_controller';
open_system(model);
testObj = cvtest(model);                   %Get test data
[data, T, X, Y] = cvsim(testObj);          %Get coverage data

See Also

cv.cvdatagroup | cvtest | simset

How To

  


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