Main Content

updateImpl

Class:matlab.System

Update object states based on inputs

Syntax

updateImpl(obj,input1,input2,...)

Description

updateImpl(obj,input1,input2,...)specifies the algorithm to update the System object™ states. You implement this method when your algorithm outputs depend only on the object’s internal state and internal properties.

Run-Time Details

updateImplis called by theupdatemethod and after theoutputImplmethod.

For sink objects, callingupdateImplbeforeoutputImpllocks the object. For all other types of objects, callingupdateImplbeforeoutputImplcauses an error.

Method Authoring Tips

  • Do not use this method to update the outputs from the inputs.

  • You must setAccess = protectedfor this method.

  • If the System object will be used in the Simulink®MATLAB System(Simulink)block, you cannot modify any tunable properties in this method.

Input Arguments

expand all

System object handle used to access properties, states, and methods specific to the object. If yourupdateImplmethod does not use the object, you can replace this input with~.

List the inputs to the System object. The order of inputs must match the order of inputs defined in thestepImplmethod.

Examples

expand all

Update the object with previous inputs. UseupdateImplin your class definition file. This example saves theuinput and shifts the previous inputs.

methods (Access = protected)functionupdateImpl(obj,u) obj.PreviousInput = [u obj.PreviousInput(1:end-1)];endend
Introduced in R2013b