matlab.System.isInputSizeMutableImpl - Set whether System object input size can change - MATLAB (original) (raw)
Main Content
Class: matlab.System
Set whether System object input size can change
Syntax
mutable = isInputSizeMutableImpl(obj,index)
Description
[mutable](#d126e2108737) = isInputSizeMutableImpl([obj](#mw%5F2eb26430-619c-424f-9492-2dda427d224d%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8),[index](#d126e2108711))
returns whether the index
th input to the object can change size when the object is in use.
Method Authoring Tips
You must set Access = protected
for this method.
Input Arguments
System object handle used to access properties, states, and methods specific to the object. If your isInputSizeMutableImpl
method does not use the object, you can replace this input with ~
.
This argument specifies which input to stepImpl
is checked for size mutability. The index number is the ordinal position of the input in the stepImpl
signature.
Output Arguments
If you do not implement this method, inputs can change size unless the[StrictDefaults](matlab.system-class.html#mw%5F38d92dea-d023-409a-a98e-fe89be5cceef)
class attribute is set. If you implement this method, returning true
means that input size can change, and false
means they cannot change.
Examples
Restrict the size of all inputs by adding theisInputSizeMutableImpl
method and returningfalse
. By adding this method, users of the System object cannot change the size of inputs while the System object is in use.
function flag = isInputSizeMutableImpl(obj,~) flag = false; end
To avoid a warning about unused variables, this example uses~
as the second input argument. For more information about using ~
in place of arguments, see Using ~ as an Input Argument in Method Definitions.
This example shows how to write the isInputSizeMutableImpl
method to only restrict the first input. isInputSizeMutableImpl
returns true
for all inputs except input the first input.
methods (Access = protected) function flag = isInputSizeMutableImpl(obj,index) flag = (index ~= 1); end end
Version History
Introduced in R2018a