isDiscreteStateSpecificationMutableImpl

Control whether discrete states can change data type

Syntax

mutable = isDiscreteStateSpecificationMutableImpl(obj)

Description

mutable = isDiscreteStateSpecificationMutableImpl(obj) returns whether discrete states can change data type when the object is in use. If this method returns false, the discrete state must maintain the same data type while the object is in use.

Note

You must set Access = protected for this method.

Input Arguments

expand all

System object whose discrete states are affected by this method.

Output Arguments

expand all

If you do not implement this method, discrete states can change data type unless the StrictDefaults class attribute is set. If you implement this method, returning true means discrete state data type can change and false means they cannot change.

Examples

Disallow Changes to Discrete States

Restrict changes to the data type of discrete states by adding the isDiscreteStateSpecificationMutableImpl method and returning false. By adding this method, users of the System object cannot change the data type of discrete states while the System object is in use.

function flag = isDiscreteStateSpecificationMutableImpl(obj)
    flag = false;
end

Introduced in R2018a

Was this topic helpful?