isDiscreteStateSpecificationMutableImpl

Class: matlab.System

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.

Method Authoring Tips

You must set Access = protected for this method.

Input Arguments

expand all

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

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