Main Content

getDiscreteStateSpecificationImpl

Class: matlab.System

Discrete state size, data type, and complexity

Syntax

[size,dataType,complexity] = getDiscreteStateSpecificationImpl(obj,propertyName)

Description

[size,dataType,complexity] = getDiscreteStateSpecificationImpl(obj,propertyName) returns the size, data type, and complexity of the discrete state property. This property must be a discrete state property. You must define this method if your System object™ has discrete state properties and is used in the MATLAB System (Simulink) block.

Run-Time Details

getDiscreteStateSpecificationImpl is called by the MATLAB System block during Simulink® model compilation.

Method Authoring Tips

  • You must set Access = protected for this method.

  • You cannot modify any properties in this method.

Input Arguments

expand all

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

Name of discrete state property of the System object

Output Arguments

expand all

Vector containing the length of each dimension of the property.

Data type of the property. For built-in data types, dataType is a character vector. For fixed-point data types, dataType is a numeric type object.

Complexity of the property as a scalar, logical value:

  • true — complex

  • false — real

Examples

expand all

Specify in your class definition file the size, data type, and complexity of a discrete state property.

methods (Access = protected)
   function [sz,dt,cp] = getDiscreteStateSpecificationImpl(~,name)
      sz = [1 1];
      dt = "double";
      cp = false;
   end
end
Introduced in R2013b