帮助中心帮助中心
类: matlab.System
设置 System object 输入的大小是否可以更改
mutable = isInputSizeMutableImpl(obj,index)
mutable = isInputSizeMutableImpl(obj,index) 返回对象的第 index 个输入是否可在对象处于使用中状态时更改大小。
mutable
obj
index
您必须先对此方法设置 Access = protected。
Access = protected
全部展开
System object 句柄,用于访问特定于该对象的属性、状态和方法。如果您的 isInputSizeMutableImpl 方法不使用该对象,您可以用 ~ 替换此输入。
isInputSizeMutableImpl
~
此参数指定对 stepImpl 的哪个输入进行大小可变性检查。索引编号是输入在 stepImpl 签名中的顺位。
stepImpl
true
false
如果不实现此方法,则输入可以更改大小(除非设置了 StrictDefaults 类特性)。如果实现此方法,则返回 true 表示输入的大小可以更改,返回 false 表示不能更改。
StrictDefaults
通过添加 isInputSizeMutableImpl 方法并返回 false,限制所有输入的大小。通过添加此方法,可以限制 System object 的用户不能在 System object 处于使用中状态时更改输入的大小。
function flag = isInputSizeMutableImpl(obj,~) flag = false; end
为了避免因为有未使用的变量而出现警告,此示例使用 ~ 作为第二个输入参数。有关使用 ~ 代替参数的详细信息,请参阅在方法定义中使用 ~ 作为输入参数。
此示例说明如何编写只限制第一个输入的 isInputSizeMutableImpl 方法。isInputSizeMutableImpl 对除第一个输入之外的所有输入都返回 true。
methods (Access = protected) function flag = isInputSizeMutableImpl(obj,index) flag = (index ~= 1); end end
在 R2018a 中推出
isInputComplexityMutableImpl | isInputDataTypeMutableImpl | matlab.System | processInputSpecificationChangeImpl
isInputComplexityMutableImpl
isInputDataTypeMutableImpl
matlab.System
processInputSpecificationChangeImpl
您点击的链接对应于以下 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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office