主要内容

open_system

开放型号,库,子系统或块对话框

描述

example

open_system(obj)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.

A model or library opens in a new window. For a subsystem or block within a model, the behavior depends on the type of block and its properties.

  • Any OpenFcn callback parameter is evaluated.

  • If there is no OpenFcn callback, and a mask is defined, the mask parameter dialog box opens.

  • Without an OpenFcn callback or a mask parameter, Simulink opens the object.

    • A referenced model opens in a new window.

    • A subsystem opens in a new tab in the same window.

    • 对于块,打开块的“参数对话框”。

To open a specific subsystem or block, you must load the model or library containing it. Otherwise Simulink returns an error.

您可以通过提供第二个输入参数来覆盖默认行为。

example

open_system(sys,'loadonly')loads the specified model or library without opening the Simulink Editor. This is equivalent to usingLOAD_SYSTEM.

example

open_system(sbsys,'窗户')打开子系统sbsysin a new Simulink Editor window. Before opening a specific subsystem or block, load the model or library containing it. Otherwise Simulink returns an error.

open_system(sbsys,'tab')打开子系统in a new Simulink Editor tab in the same window. Before opening a specific subsystem or block, load the model or library containing it. Otherwise Simulink returns an error.

example

open_system(BLK,'面具')opens the mask dialog box of the block or subsystem specified byBLK. Load the model or library containingBLKbefore opening it.

open_system(BLK,'力量')在蒙版块或子系统的面具下看。它在蒙版下打开块的对话框,或在新的Simulink编辑选项卡中打开蒙版子系统。金宝app这等同于Look Under Maskmenu item. Before opening a specific subsystem or block, load the model or library containing it. Otherwise Simulink returns an error.

open_system(BLK,'范围')opens the block parameter dialog box.

open_system(BLK,'OpenFcn')运行块回调OpenFCN.

Examples

collapse all

Open thef14model.

open_system('f14')

加载f14model.

open_system('f14','loadonly')

Open the Controller subsystem of thef14model.

LOAD_SYSTEM('f14') open_system('F14/Controller')

Open the f14 model and open the控制器subsystem in a new tab.

f14 open_system('F14/Controller','标签')

Open a subsystem in its own Simulink Editor window.

open_system('f14') open_system('F14/Controller','窗户')

打开模型sldemo_mdlref_counter,由反击引用模型块INsldemo_mdlref_basic.

open_system('sldemo_mdlref_basic') open_system('sldemo_mdlref_basic/countera')

The referenced model opens in its own Simulink Editor window as a top model. To open the referenced model in the context of a model hierarchy, use theopenfunction with aSimulink.BlockPath目的。

打开“块参数”对话框,以获取第一个增益块控制器子系统。

LOAD_SYSTEM('f14') open_system('F14/Controller/Gain')

定义OpenFCNcallback for a block and execute the block callback.

f14 set_param('f14/Pilot','OpenFCN','disp(''Hello World!'')') open_system('f14/Pilot','OpenFCN')

The wordsHello World出现在MATLAB命令提示符上。

Open the contents of the masked subsystem Vehicle in the modelsf_car.

open_system('sf_car') open_system('sf_car/Vehicle','force')

Create a cell array of two model names,f14VDP. Open both models usingopen_system带有单元格数字。

models = {'f14','vdp'} open_system(models)

Input Arguments

collapse all

指定为字符向量的模型,引用模型,库,子系统或块路径。如果模型不在MATLAB路径上,请指定模型文件的完整路径。使用其全名来指定块或子系统,例如f14/Controller/Gain,在打开或加载的模型上。在Unix上®systems, the fully qualified path name of a model can start with a tilde (~), signifying your home directory.

Data Types:char

模型或库的全名或路径,指定为字符向量。

Data Types:char

The full name or path of a subsystem in an open or loaded model, specified as a character vector.

Data Types:char

The full name or path of a block or subsystem in an open or loaded model, specified as a character vector.

Data Types:char

提示

To open a referenced model in the context of a model hierarchy, use theopenfunction with aSimulink.BlockPath目的。

在R2006a之前引入