Main Content

open

Open specified model, library, subsystem, or block

Description

example

open(bp)opens the specified model, library, subsystem, or block. This is equivalent to double-clicking the model or library in the Current Folder browser or the subsystem or block in the Simulink®Editor.

example

open(bp,Name,Value)opens the specified model, library, subsystem, or block with additional options.

Examples

collapse all

创建一个Simulink.BlockPathobject that represents a referenced model within a model hierarchy.

load_system('sldemo_mdlref_depgraph') bp = Simulink.BlockPath({'sldemo_mdlref_depgraph/thermostat',...'sldemo_mdlref_heater/Fahrenheit to Celsius'});

Open the referenced model specified bybpin the context of the model hierarchy.

open(bp)

Open thesldemo_mdlref_depgraphmodel.

sldemo_mdlref_depgraph

创建一个Simulink.BlockPathobject that represents a referenced model within a model hierarchy.

bp = Simulink.BlockPath({'sldemo_mdlref_depgraph/thermostat',...'sldemo_mdlref_heater/Fahrenheit to Celsius'})

Open the referenced model specified bybpin a new window.

open(bp,'OpenType','new-window')

Input Arguments

collapse all

Fully specified block path, specified as aSimulink.BlockPathobject. This block path uniquely identifies a block within a model hierarchy, even when the model hierarchy references the same model multiple times.

Name-Value Pair Arguments

Specify optional comma-separated pairs ofName,Valuearguments.Nameis the argument name andValueis the corresponding value.Namemust appear inside quotes. You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN.

Example:open(bp,'OpenType','new-window')

Option to open object in a new tab or window, specified as the comma-separated pair consisting of'OpenType'and'current-tab','new-tab', or'new-window'. This option determines whether the subsystem or model specified by aSimulink.BlockPathobject opens in the current window and tab, a new tab, or a new window, respectively.

Data Types:char|string

Option to open the object under the block mask, specified as the comma-separated pair consisting of'Force'and'off'or'on'. When this argument is set to'off', the function opens the block mask. When this argument is set to'on', the function opens the dialog box of the block under the mask or opens the masked system in a new tab, which is equivalent to theLook Under Maskmenu item. It forces theSimulink.BlockPathobject to open, regardless of the block mask.

Data Types:char|string

See Also

Objects

Functions

Introduced in R2019a