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.
outputImpl is called by the internal
output method. It is also called before the
updateImpl method. For sink objects, calling
outputImpl locks the object. For all other types of objects, calling
outputImpl causes an error.
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.
obj— System object
System object handle used to access properties, states, and methods specific to the object. If
outputImpl method does not use the object, you can replace this
u1,u2,...uN— Inputs to the algorithm
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.
y1,y2,...yN— Outputs of the algorithm
Outputs calculated from the specified algorithm. The number of outputs must
match the number of outputs returned by the
Specify in your class definition file that the output does not
directly depend on the current input with the
PreviousInput is a property of the
methods (Access = protected) function [y] = outputImpl(obj, ~) y = obj.PreviousInput(end); end end