getDiscreteStateImpl

Class: matlab.System
Package: matlab

Discrete state property values

Syntax

s = getDiscreteStateImpl(obj)

Description

s = getDiscreteStateImpl(obj) returns a struct s of state values. The field names of the struct are the object's DiscreteState property names. To restrict or change the values returned by getDiscreteState method, you can override this getDiscreteStateImpl method.

getDiscreteStatesImpl is called by the getDiscreteState method, which is called by the setup method.

    Note:   You must set Access = protected for this method.

    You cannot modify any properties in this method.

Input Arguments

obj

System object™ handle

Output Arguments

s

Struct of state values.

Examples

expand all

Get Discrete State Values

Use the getDiscreteStateImpl method in your class definition file to get the discrete states of the object.

methods (Access = protected)
   function s = getDiscreteStateImpl(obj)
   end
end
Was this topic helpful?