update
Update state of a System object based on inputs
Description
update(
updates the states of a System object™ based on the algorithm specified in the obj
,input1, input2, ..., inputN
)updateImpl
method.
Examples
Update the states of a System object
Call update to update the states of a System object.
Consider a System object object defined as,
classdef UnitDelayNondirect < matlab.System % UnitDelayNondirect Delay input by one time step properties(DiscreteState) State end methods(Access = protected) function resetImpl(obj) obj.State = 0; % Initialize states end function y = outputImpl(obj, ~) y = obj.State; % Output current state end function updateImpl(obj,u) obj.State = u; % Update state with input end end end
Create an instance of the System object and provide it with an input.
a = UnitDelayNondirect(); out = a(1);
Call update to update the states of the System object with new inputs.
update(a,2);
Input Arguments
obj
— System object
System object
System object handle used to access properties, states, and methods specific to the object.
input1, input2, ..., inputN
— Inputs to the System object
inputs
Inputs to the System object. The order of inputs must match the order of inputs
defined in the updateImpl
method.
Version History
Introduced in R2012a
See Also
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)