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

Create a Simulink.BlockPath object 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 by bp in the context of the model hierarchy.

open(bp)

Open the sldemo_mdlref_depgraph model.

sldemo_mdlref_depgraph

Create a Simulink.BlockPath object 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 by bp in a new window.

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

Input Arguments

collapse all

Fully specified block path, specified as a Simulink.BlockPath object. 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 of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,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 a Simulink.BlockPath object 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 the Look Under Mask menu item. It forces the Simulink.BlockPath object to open, regardless of the block mask.

Data Types: char | string

See Also

Objects

Functions

Introduced in R2019a