Documentation

This is machine translation

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

updateImpl

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

Update object states based on inputs

Syntax

updateImpl(obj,u1,u2,...,uN)

Description

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

obj

System object handle

u1,u2,...uN

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

Examples

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)]; 
   end
end
Was this topic helpful?