Class: matlab.system.mixin.Nondirect
Package: matlab.system.mixin

Update object states based on inputs




updateImpl(obj,u1,u2,...,uN) implements the state update equations for the system. You use this method when your algorithm outputs depend only on the object's internal state and internal properties. Do not use this method to update the outputs from the inputs.

updateImpl is called by the update method and after the outputImpl 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.

Input Arguments


System object handle


Inputs to the algorithm or step method. The number of inputs must match the number of inputs returned by the getNumInputs method.


expand all

Set Up Output that Does Not Depend on Current Input

Update the object with previous inputs. Use updateImpl in your class definition file. This example saves the u input and shifts the previous inputs.

methods (Access = protected)
   function updateImpl(obj,u)
      obj.PreviousInput = [u obj.PreviousInput(1:end-1)]; 
Was this topic helpful?