Simulink.Mask 类
命名空间: Simulink
以编程方式控制封装
描述
使用 Simulink.Mask
类的实例可执行以下操作:
创建、复制和删除封装。
创建、编辑和删除封装参数。
确定拥有封装的模块。
获取为封装定义的工作区变量。
属性
Type
— 模块的封装类型
字符向量 (默认) | 字符串
相关联的模块的封装类型,指定为字符向量或字符串。
数据类型: char
| string
Description
— 模块描述
字符向量 (默认) | 字符串
模块的描述,指定为字符向量或字符串。
数据类型: char
| string
Help
— 封装模块的帮助文本
字符向量 (默认) | 字符串
封装模块的帮助文本,指定为字符向量或字符串。
数据类型: char
| string
Initialization
— 初始化命令
字符向量 (默认) | 字符串
封装模块的初始化命令,指定为字符向量或字符串。
数据类型: char
| string
SelfModifiable
— 允许模块修改其内容的选项
off
(默认) | on
允许模块修改其内容的选项,指定为逻辑值。
数据类型: logical
Display
— 模块图标的 MATLAB® 代码
字符向量 (默认) | 字符串
模块图标的 MATLAB 代码,指定为字符向量或字符串。
数据类型: char
| string
IconFrame
— 模块边框的可见性
off
(默认) | on
模块边框的可见性,指定为逻辑值。
数据类型: logical
IconOpaque
— 使图标不透明的选项
opaque
(默认) | transparent
使图标不透明的选项,指定为逻辑值。
不透明:使图标不透明。
透明:使图标透明。
数据类型: logical
RunInitForIconRedraw
— 执行绘图命令前运行初始化的选项
auto
(默认) | on
| off
在执行封装图标命令之前运行封装初始化命令的选项,指定为枚举数据类型。
数据类型: enum
IconRotate
— 随模块旋转图标的选项
无 (默认) | 端口
随模块旋转图标的选项,指定为枚举数据类型。
数据类型: enum
PortRotate
— 端口旋转类型
默认值 (默认) | 物理
端口旋转类型,指定为枚举数据类型。将此属性设置为 default
以在顺时针旋转后对端口进行重新排序,以保持从左到右的端口编号顺序(对于位于模块上下两端的端口)以及从上到下的端口编号顺序(对于位于模块左右两侧的端口)。将此属性设置为 physical
可随模块旋转端口,而不会在顺时针旋转后对其重新排序。
数据类型: enum
IconUnits
— 绘图命令的单位
自动缩放 (默认) | 像素 | 归一化
绘图命令的单位,指定为枚举类型。autoscale
会缩放图标以适应模块边框。normalized
在左下角为 (0,0)、右上角为 (1,1) 的模块边框内绘制图标。只显示从 0 到 1 的 X 和 Y 值。调整模块大小时,图标也会随之调整大小。pixels
使用以像素表示的 X 和 Y 值绘制图标。在调整模块大小时,图标大小不会自动调整。
数据类型: enum
SaveCallbackFileWithModel
— 与模型一起保存回调文件的选项
off
(默认) | on
如果在单独的 MAT 文件中有封装初始化代码和回调代码,则使用此选项将回调文件与模型一起保存;指定为逻辑值。
数据类型: logical
CallbackFile
— 回调文件的名称
空 (默认) | 字符向量 | 字符串
包含封装初始化代码和回调代码的回调文件的名称,指定为字符向量或字符串。
数据类型: char
| string
Parameters
— 封装参数属性
Simulink.MaskParameter
对象 (默认)
封装参数属性,指定为 Simulink.MaskParameter
对象。
PortIdentifiers
— 端口标识符属性
Simulink.Mask.PortIdentifiers
对象 (默认)
端口标识符属性,指定为 Simulink.Mask.PortIdentifiers
对象。
ParameterConstraints
— 参数约束属性
Simulink.Mask.Constraints
对象 (默认)
添加或删除参数约束规则的选项,指定为 Simulink.Mask.Constraints
对象。
CrossParameterConstraints
— 参数之间的约束
Simulink.Mask.CrossParameterConstraints
(默认)
参数之间的约束,指定为 Simulink.Mask.CrossParameterConstraints
。
PortConstraints
— 端口约束属性
Simulink.Mask.PortConstraint
对象 (默认)
添加或删除端口约束的选项,指定为 Simulink.Mask.PortConstraint
对象。
CrossPortConstraints
— 交叉端口约束属性
Simulink.Mask.CrossPortConstraint
对象 (默认)
添加或删除封装模块端口约束的选项,指定为 Simulink.Mask.CrossPortConstraint
对象。
方法
公共方法
addCrossParameterConstraint | Add cross-parameter constraint |
addCrossPortConstraint | Create cross-port constraint among ports of the same masked block |
addDialogControl | Add dialog control elements to mask dialog box |
addParameter | Add a parameter to a mask |
addParameterConstraint | Add parameter constraint to a mask |
addPortConstraint | Create port constraint on a mask object |
addPortConstraintAssociation | Associate port constraints to port identifiers |
addPortIdentifier | Creates a port identifier to identify port in mask |
addCrossParameterConstraint | Add cross-parameter constraint |
copy | |
Simulink.Mask.create | Create a mask on a Simulink block |
delete | Unmask a block and delete the mask from memory |
get | 从指定的模块中返回封装 |
getPortConstraintAssociation | Displays port identifiers associated with port constraint |
getAssociatedParametersOfConstraint | Get mask parameters associated with a constraint |
getCrossParameterConstraint | Get cross-parameter constraint |
getCrossPortConstraint | Display attributes of cross-port constraint |
getDialogControl | Search for a specific dialog control on the mask |
getOwner | Determine the block that owns a mask |
getParameter | 按名称获取封装参数 |
getParameterConstraint | Get mask parameter constraint properties |
getPortConstraint | Displays attributes of specified port constraint |
getPortConstraintAssociation | Displays port identifiers associated with port constraint |
getPortIdentifier | Displays attributes of specified port identifier |
getWorkspaceVariables | Get variables defined in mask workspace for masked block |
numParameters | Display number of parameters in a mask |
removeAllCrossParameterConstraints | Delete all cross-parameter constraints from a mask |
removeAllParameterConstraints | Delete all mask parameter constraints |
removeAllParameters | Remove all existing parameters from a mask |
removeAllCrossPortConstraints | Remove all cross-port constraints from mask object |
removeAllPortConstraintAssociation | Removes the associations of all port constraints from mask |
removeAllPortConstraints | Remove all port constraints on masked block |
removeAllPortIdentifiers | Removes all port identifiers from mask object |
removeCrossParameterConstraint | Delete a cross-parameter constraint |
removeCrossPortConstraint | Remove cross-port constraint |
removeDialogControl | Remove dialog control from mask dialog box |
removeParameter | Remove parameter from mask dialog box |
removeParameterConstraint | Delete a mask parameter constraint |
removePortConstraint | Remove specified port constraint |
removePortIdentifier | Removes specified port identifier from mask object |
removePortConstraintAssociation | Remove association between port constraint and port identifiers |
set | Set properties of an existing mask |
版本历史记录
在 R2010a 中推出
另请参阅
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)