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

Open the project named ModelReferenceHierarchy.

openProject("ModelReferenceHierarchy");

The project opens a model hierarchy with sldemo_mdlref_depgraph as the top model.

Create a Simulink.BlockPath object named bp that represents a referenced model within the model hierarchy.

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 project named ModelReferenceHierarchy.

openProject("ModelReferenceHierarchy");

The project opens a model hierarchy with sldemo_mdlref_depgraph as the top model.

Create a Simulink.BlockPath object named bp 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 Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

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

Version History

Introduced in R2019a

See Also

Objects

Functions