open_system
R2026bOpen model, library, subsystem, or block dialog box
Syntax
Description
open_system(
opens the specified model, library, subsystem, Block Parameters dialog box, or
mask dialog box, or runs the specified obj)OpenFcn callback
function.
Note
Security Considerations: Before you
open the model using open_system, make sure you
trust the sender or the author of the model. Models from unknown sources
might contain unsafe content. Unknown sources include models you clone
from a remote repository, download, or receive as an archive.
Libraries and models, including referenced models, open in a new window. To
open a referenced model in the context of a model hierarchy, use the open function with a Simulink.BlockPath object
instead.
To take these actions, in the function arguments, specify the corresponding block:
Run an
OpenFcncallback function.Open a subsystem in a new tab in the same window.
Open a mask dialog box.
Open a Block Parameters dialog box.
The model or library containing the specified block must be loaded. The function takes the first of these actions that applies:
If the block has an
OpenFcncallback function, run the function.If the block has a mask, open the mask dialog box.
If the block is not a Subsystem block, open the Block Parameters dialog box.
If the block is a Subsystem block, open the subsystem in a new tab in the same window. Do not open the Block Parameters dialog box.
For example, if a block does not have an OpenFcn callback
function, but does have a mask, the mask dialog box opens.
You can override the default function behavior by specifying more than one input argument. The following are valid combination of arguments:
To look under the mask of a block in a new window or new tab, use
ForcewithTaborWindow.To open the active choice of a Variant Subsystem block in a new tab or a new window, use
ActiveChoicewithTaborWindow. If one of the arguments isActiveChoice, then the content inside a masked active choice is opened by passingForceas another argument paired withTaborWindow.
The following combinations of input arguments will error out.
If you specify arguments
parameter,mask, andOpenFcnwith any other argument exceptActiveChoice.If you specify
ActiveChoiceon any other block other than a Variant Subsystem block.If you specify
forcewith any other argument other thanActiveChoice,window, ortab.If you specify both
windowandtabas arguments.If you specify
loadonlywith any other argument.
open_system( loads
the specified model or library without opening the Simulink® Editor. Using this syntax is equivalent to calling the sys,"loadonly")load_system function.
open_system(
opens the mask dialog box of the specified block.block,"mask")
open_system(
looks under the mask of a masked block or subsystem. This syntax opens the Block
Parameters dialog box of the block under the mask or opens a masked subsystem in
a new tab in the Simulink Editor. Using this syntax is equivalent to the Look
Inside Mask menu item.block,"force")
open_system( opens the content of a masked subsystem in a new window.block,"force","window")
open_system(
opens the Block Parameters dialog box even if the block has an
block,"parameter")OpenFcn callback function or a mask.
open_system(
runs the block,"OpenFcn")OpenFcn callback function for the specified
block.
Examples
Input Arguments
Tips
To open a referenced model in the context of a model hierarchy, use the open
function with a Simulink.BlockPath object.
Version History
Introduced before R2006a