Documentation Center

  • Trial Software
  • Product Updates


Class: matlab.System
Package: matlab

Number of input arguments passed to step and setup methods


num = getNumInputsImpl(obj)


num = getNumInputsImpl(obj) returns the number of inputs num (excluding the System object™ handle) expected by the step method.

If your step method has a variable number of inputs (uses varargin), you should implement the getNumInputsImpl method in your class definition file. If the number of inputs expected by the step method is fixed (does not use varargin), the default getNumInputsImpl determines the required number of inputs directly from the step method. In this case, you do not need to include getNumInputsImpl in your class definition file.

getNumInputsImpl is called by the getNumInputs method and by the setup method if the number of inputs has not been determined already.

    Note:   You must set Access=protected for this method.

    You cannot modify any properties in this method.

Input Arguments


System object handle

Output Arguments


Number of inputs expected by the step method for the specified object.

Default: 1


expand all

Set Number of Inputs

Specify the number of inputs (2, in this case) expected by the step method.

methods (Access=protected)
   function num = getNumInputsImpl(obj)
      num = 2;

Set Number of Inputs to Zero

Specify that the step method will not accept any inputs.

methods (Access=protected)
   function num = getNumInputsImpl(~)
      num = 0;

See Also

| |

How To

Was this topic helpful?