isInputComplexityMutableImpl
设置 System object 输入的复/实性是否可以更改
语法
mutable = isInputComplexityMutableImpl(obj,index)
说明
返回对象的第 mutable
= isInputComplexityMutableImpl(obj
,index
)index
个输入是否可在对象处于使用中状态时更改复/实性。
方法编写提示
您必须先对此方法设置 Access = protected
。
输入参数
obj
— System object™
System object
System object 句柄,用于访问特定于该对象的属性、状态和方法。如果您的 isInputComplexityMutableImpl
方法不使用该对象,您可以用 ~
替换此输入。
index
— 输入的有序索引
正整数
此参数指定对 stepImpl
的哪个输入进行复/实性可变性检查。索引编号是输入在 stepImpl
签名中的顺位。
输出参数
mutable
— 输入的复/实性是否可以更改
true
| false
如果不实现此方法,则输入可以更改复/实性(除非设置了 StrictDefaults
类特性)。如果实现此方法,则返回 true
表示输入的复/实性可以更改,返回 false
表示不能更改。
示例
限制输入的复/实性更改
通过添加 isInputComplexityMutableImpl
方法并返回 false
,限制所有输入的复/实性。通过添加此方法,可以限制 System object 的用户不能在 System object 处于使用中状态时更改输入的复/实性。
function flag = isInputComplexityMutableImpl(obj,~) flag = false; end
为了避免因为有未使用的变量而出现警告,此示例使用 ~
作为第二个输入参数。有关使用 ~
代替参数的详细信息,请参阅在方法定义中使用 ~ 作为输入参数。
限制一个输入的复/实性更改
此示例说明如何编写只限制一个输入的 isInputComplexityMutableImpl
方法。isInputComplexityMutableImpl
对除第一个输入之外的所有输入都返回 true
。
methods (Access = protected) function flag = isInputComplexityMutableImpl(obj,index) flag = (index ~= 1); end end
版本历史记录
在 R2018a 中推出
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)