getInputNamesImpl

Class: matlab.System
Package: matlab

Names of the input ports of the System block

Syntax

[name1,name2,...] = getInputNamesImpl(obj)

Description

[name1,name2,...] = getInputNamesImpl(obj) returns the names of the input ports to System object, obj implemented in a MATLAB System block. The number of returned input names matches the number of inputs returned by the getNumInputs method. If you change a property value that changes the number of inputs, the names of those inputs also change.

getInputNamesImpl is called by the getInputNames method by the MATLAB System block.

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

Input Arguments

obj

System object™ handle

Output Arguments

name1,name2,...

Names of the inputs for the specified object.

Default: empty string

Examples

expand all

Specify Input Port Name

Specify in your class definition file the names of two input ports as 'upper' and 'lower'.

methods (Access = protected)
   function varargout = getInputNamesImpl(obj)
      numInputs = getNumInputs(obj);
      varargout = cell(1,numInputs);
      varargout{1} = 'upper';
      if numInputs > 1
         varargout{2} = 'lower';
      end
   end
end
Was this topic helpful?