%% Extract Subchart and Copy to a New Model
% This example shows how to extract an atomic Stateflow&reg; chart from a
% model and copy it to a new model using |slvnvextract|.

% Copyright 2020 The MathWorks, Inc.

%%
% Load the |slvnvdemo_covfilt| model.

modelName = 'slvnvdemo_covfilt';
load_system(modelName);

%%
% Extract the Mode Logic atomic subchart from the model and copy it into a
% new model.

newModel = slvnvextract([modelName,'/Mode Logic'],true)