This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


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

Update object states based on inputs




updateImpl(obj,u1,u2,...,uN) specifies the algorithm to update the System object™ states. 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. 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. The number of inputs must match the number of inputs returned by the getNumInputs method.


expand all

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?