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) implements the output equations for the System object. The output values are calculated from the states and property values. Any inputs that you set to nondirect feedthrough are ignored during output calculation.
outputImpl is called by the output method. It is also called before the updateImpl method in the step method. For sink objects, calling updateImpl before outputImpl locks the object. For all other types of objects, calling updateImpl before outputImpl causes an error.
Note: You must set Access = protected for this method.
You cannot modify any tunable properties in this method if its System object™ will be used in the Simulink® MATLAB System block.
System object handle
Inputs from the algorithm or step method. 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.
Outputs calculated from the specified algorithm. The number of outputs must match the number of outputs returned by the getNumOutputs method.
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); end end