Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getDiscreteStateSpecificationImpl

Class: matlab.system.mixin.Propagates
Package: matlab.system.mixin

Discrete state size, data type, and complexity

Syntax

[sz,dt,cp] = getDiscreteStateSpecificationImpl(obj,propertyname)

Description

[sz,dt,cp] = 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 block. If you define this method for a property that is not discrete state, an error occurs during model compilation.

You always set the getDiscreteStateSpecificationImpl method access to protected because it is an internal method that users do not directly call or run.

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

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

    You cannot modify any properties in this method.

Input Arguments

obj

System object handle

propertyname

Name of discrete state property of the System object

Output Arguments

sz

Vector containing the length of each dimension of the property.

Default: [1 1]

dt

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

Default: double

cp

Complexity of the property as a scalar, logical value, where true = complex and false = real.

Default: false

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
Was this topic helpful?