This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Class: matlab.System
Package: matlab

Number of inputs to the System object


num = getNumInputsImpl(obj)


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

If your object has a variable number of inputs (uses varargin), implement the getNumInputsImpl method in your class definition file.

If the number of inputs expected by the object is fixed (does not use varargin), the default getNumInputsImpl determines the required number of inputs. 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.


You must set Access = protected for this method.

You cannot modify any properties in this method.

If you set the return argument, num, from an object property, that object property must have the Nontunable attribute.

Input Arguments


System object

Output Arguments


Number of inputs expected when running the object, returned as an integer.

Default: 1


expand all

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

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

Specify that the object does not accept any inputs.

methods (Access = protected)
   function num = getNumInputsImpl(~)
      num = 0;
Was this topic helpful?