Documentation Center

  • Trials
  • Product Updates

slvnvextract

Extract subsystem or subchart contents into new model

Syntax

newModel = slvnvextract(subsystem)
newModel = slvnvextract(subchart)
newModel = slvnvextract(subsystem, showModel)
newModel = slvnvextract(subchart, showModel)

Description

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

newModel = slvnvextract(subchart) extracts the contents of the atomic subchart subchart and creates a new model. subchart should specify the full path of the atomic subchart. slvnvextract uses the subchart name for the model name, appending a numeral to the model name if that model name already exists.

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

newModel = slvnvextract(subsystem, showModel) and newModel = slvnvextract(subchart, showModel) open the extracted model if you set showModel to true. The extracted model is only loaded if showModel is set to false.

Input Arguments

subsystem

Full path to the atomic subsystem

subchart

Full path to the atomic subchart

showModel

Boolean indicating whether to display the extracted model

Default: True

Output Arguments

newModel

Name of the new model

Examples

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 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);
Was this topic helpful?