| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink Verification and Validation |
| Contents | Index |
| Learn more about Simulink Verification and Validation |
cvdg = cvsimref(topModelName)
cvdg = cvsimref(topModelName, cvtg)
[cvdg,t,x,y] = cvsimref(topModelName, cvtg)
[cvdg,t,x,y] = cvsimref(topModelName, cvtg, timespan,
options)
[cvdg1, cvdg2, ...] = cvsimref(topModelName, cvtg1,
cvtg2, ...)
cvdg = cvsimref(topModelName) simulates the top model and all referenced models in the hierarchy, collects model coverage data, and returns the results in the cv.cvdatagroup object cvdg. You do not have to enable model coverage reporting for any of the models in a model hierarchy to use the cvsimref command.
cvdg = cvsimref(topModelName, cvtg) simulates topModelName and collects model coverage data by executing the cv.cvtestgroup object cvtg. cvtg contains cvtest specifications for the top-level model and all the referenced models in the hierarchy. cvsimref returns the model coverage results in cvdg.
[cvdg,t,x,y] = cvsimref(topModelName, cvtg) returns the time vector t, matrix of state values x, and matrix of output values y from the simulation.
[cvdg,t,x,y] = cvsimref(topModelName, cvtg, timespan, options) overrides default simulation values with the values in timespan and options.
[cvdg1, cvdg2, ...] = cvsimref(topModelName, cvtg1, cvtg2, ...) executes multiple cv.cvtestgroup objects and returns the results in a set of cv.cvdatagroup objects.
cvtg |
cv.cvtestgroup object that contains test specifications for the referenced models in the hierarchy | ||||||
options |
Optional simulation parameters specified as a structure created by the simset command. | ||||||
timespan |
Simulation start and stop time:
| ||||||
topModelName |
Name of the top-level model in the hierarchy |
cvdg |
cv.cvdatagroup object |
t |
The simulation time vector |
x |
The simulation state matrix consisting of continuous states followed by discrete states |
y |
The simulation 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. |
Open and simulate the slvnvdemo_ratelim_harness model and its two subsystems:
topModel = 'slvnvdemo_cv_mutual_exclusion'; load_system(topModel); % Make sure coverage is off for this run for the entire tree set_param(topModel,'RecordCoverage','off'); set_param(topModel,'CovModelRefEnable','Off'); [T1, X1, Y1] = sim(topModel); % Normal data [allData, T2, X2, Y2] = cvsimref(topModel); % cvsimref data
cv.cvdatagroup | cv.cvtestgroup | cvsim | cvtest | simset
![]() | cvsim | cvtest | ![]() |

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 |