|
|
|
| R2012a Documentation → Simulink Verification and Validation | |
Learn more about Simulink Verification and Validation |
|
| Contents | Index |
cvdo = cvsim(cvto)
[cvdo,simOut]
= cvsim(cvto,Name1,Value1,Name2,Value2,...)
[cvdo,simOut]
= cvsim(cvto,ParameterStruct)
[cvdo1,cvdo2,...,simOut]
= cvsim(cvto1,cvto2,...)
cvdo = cvsim(cvto) simulates the model and returns the coverage results for the cvtest object, cvto. cvsim saves the coverage results in the cvdata object, cvdo. However, when recording coverage for multiple models in a hierarchy, cvsim returns the coverage results in a cv.cvdatagroup object.
[cvdo,simOut] = cvsim(cvto,Name1,Value1,Name2,Value2,...) specifies the model parameters and simulates the model. cvsim returns the coverage results in the cvdata object, cvdo, and returns the simulation outputs in the Simulink.SimulationOutput object, simOut.
[cvdo,simOut] = cvsim(cvto,ParameterStruct) sets the model parameters specified in a structure ParameterStruct, simulates the model, returns the coverage results in cvdo, and returns the simulation outputs in simOut.
[cvdo1,cvdo2,...,simOut] = cvsim(cvto1,cvto2,...) simulates the model and returns the coverage results for the test objects, cvto1, cvto2, .... cvdo1 contains the coverage results for cvto1, cvdo2 contains the coverage results for cvto2, and so on.
Note Even if you have not enabled coverage recording for the model, you can execute the cvsim command to record coverage for your model. |
cvto |
cvtest object that specifies coverage options for the simulation |
Specify optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
'ParameterName' |
Name of the model parameter to be specified for simulation |
'ParameterValue' |
Value of the model parameter |
Note For a complete list of model parameters, see Model Parameters in the Simulink documentation. |
cvdo |
cvdata object |
simOut |
A Simulink.SimulationOutput object that contains the simulation outputs. |
Open the vdp model, create the test object, set the model parameters, and simulate the model. cvsim returns the coverage data in cvdo and the simulation outputs in the Simulink.SimulationOutput object, simOut:
model = 'sldemo_fuelsys'; open_system(model); testObj = cvtest(model); % Get test data paramStruct.CovMetricSettings = 'dcm'; paramStruct.AbsTol = '1e-5'; paramStruct.SaveState = 'on'; paramStruct.StateSaveName = 'xoutNew'; paramStruct.SaveOutput = 'on'; paramStruct.OutputSaveName = 'youtNew'; [cvdo,simOut] = cvsim(testObj,paramStruct); % Get coverage
cv.cvdatagroup | cvtest | sim

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |