Documentation Center

  • Trial Software
  • Product Updates

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) 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

obj

System object handle

u1,u2,...uN

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

Examples

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)]; 
   end
end

See Also

How To

Was this topic helpful?