slvnvextract

Extract subsystem or subchart contents into new model

Description

newModel = slvnvextract(subcomponent) extracts the contents of the Atomic Subsystem block or atomic subchart subcomponent and creates a model. slvnvextract returns the name of the new model in newModel. If the model name already exists,slvnvextract uses the subsystem or subchart name for the model name, appending a numeral to the model name.

Note

If an atomic subchart calls an exported graphical function that is outside the subchart, slvnvextract creates the model, but the new model does not compile.

newModel = slvnvextract(subcomponent,showModel) opens the extracted model if you set showModel to true. The extracted model is loaded only if you set showModel to false.

Input Arguments

collapse all

The full path to the atomic subsystem or atomic subchart whose contents are extracted.

Specify if you want the extracted model to be displayed.

Output Arguments

collapse all

Reports the name of the new extracted model created by slvnvextract.

Examples

Extract Subsystem and Copy to a New Model

Extract the Atomic Subsystem block, Bus Counter, from the sldemo_mdlref_conversion model and copy it into a new model:

open_system('sldemo_mdlref_conversion');
newmodel = slvnvextract('sldemo_mdlref_conversion/Bus Counter', true);

Extract Subchart and Copy to a New Model

Extract the Atomic Subchart block, Sensor1, from the sf_atomic_sensor_pair model and copy it into a new model:

open_system('sf_atomic_sensor_pair');
newmodel = slvnvextract('sf_atomic_sensor_pair/RedundantSensors/Sensor1', true);

Introduced in R2010b