Main Content


Class: matlab.System

Control whether discrete states can change data type


mutable = isDiscreteStateSpecificationMutableImpl(obj)


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.

The isDiscreteStateSpecificationMutableImpl method has no effect on the MATLAB System block. Discrete state specification is always immutable in the MATLAB System block.

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.


expand all

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;
Introduced in R2018a