matlab.system.updateImpl - Update object states based on inputs - MATLAB (original) (raw)

Main Content

Class: matlab.System

Update object states based on inputs

Syntax

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

Description

updateImpl([obj](#btrsa8%5F-1%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8),[input1,input2,...](#btrsa8%5F-1%5Fsep%5Fmw%5Fcee6147f-e421-40a4-b75e-2f2097ee5356)) 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

updateImpl is called by the update method and after the outputImpl method.

For sink objects, calling updateImpl beforeoutputImpl locks the object. For all other types of objects, callingupdateImpl before outputImpl causes an error.

Method Authoring Tips

Input Arguments

expand all

obj — System object

System object

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

input1,input2,... — Inputs to the System object

inputs to the System object

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

Examples

expand all

Set Up Output that Does Not Depend on Current Input

Update the object with previous inputs. UseupdateImpl in your class definition file. This example saves theu input and shifts the previous inputs.

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

Version History

Introduced in R2013b