%% Save Coverage Results
% This example shows how to save coverage data to a file.

% Copyright 2020 The MathWorks, Inc.

%%
% Move the current MATLAB&reg; directory to the location that contains the
% example files.
%

openExample('slcoverage/SaveCoverageResultsExample')

%%
% Start by loading the model into memory.

modelName = 'slvnvdemo_cv_small_controller';
load_system(modelName);

%%
% Simulate the model with the coverage settings that are saved with the
% model. If you have not set coverage settings, then |cvsim| uses the
% default settings.
%

covData = cvsim(modelName);

%%
% Save a coverage data file called *coverage_data*, containing the coverage
% data in the |cvdata| object *covData*.
%

cvsave('coverage_data',covData);