Main Content


Output calculation from input or internal state of System object


[y1,y2,...,yN] = outputImpl(obj,u1,u2,...,uN)


[y1,y2,...,yN] = outputImpl(obj,u1,u2,...,uN) specifies the algorithm to output the System object™ states. The output values are calculated from the states and property values. Any inputs that you set to nondirect feedthrough are ignored during output calculation.

Run-Time Details

outputImpl is called by the internal output method. It is also called before the updateImpl method. For sink objects, calling updateImpl before outputImpl locks the object. For all other types of objects, calling updateImpl before outputImpl causes an error.

Method Authoring Tips

  • You must set Access = protected for this method.

  • If the System object will be used in the Simulink® MATLAB System block, you cannot modify any tunable properties in this method.

Input Arguments

expand all

System object handle used to access properties, states, and methods specific to the object. If your outputImpl method does not use the object, you can replace this input with ~.

Inputs from the algorithm. The number of inputs must match the number of inputs returned by the getNumInputs method. Nondirect feedthrough inputs are ignored during normal execution of the System object. However, for code generation, you must provide these inputs even if they are empty.

Output Arguments

expand all

Outputs calculated from the specified algorithm. The number of outputs must match the number of outputs returned by the getNumOutputs method.


expand all

Specify in your class definition file that the output does not directly depend on the current input with the outputImpl method. PreviousInput is a property of the obj.

methods (Access = protected)
   function [y] = outputImpl(obj, ~)
      y = obj.PreviousInput(end);
Introduced in R2013b