Stateflow.DataType
Data type properties for data and messages
Description
Use a Stateflow.DataType
object to specify the data type
properties for a data object or message.
Creation
Each data object and message has its own Stateflow.DataType
object. To
access the Stateflow.DataType
object, use the Props.Type
property for the Stateflow.Data
or Stateflow.Message
object.
Properties
Stateflow® API objects have properties that correspond to the values you set in the Stateflow
Editor. To access or modify a property, use dot notation. To access or modify multiple
properties for multiple API objects, use the get
and
set
functions, respectively. For more information, see Modify Properties and Call Functions of Stateflow Objects.
Method for setting the type of the data object or message, specified as a string scalar or character vector.
For local, input, output, or parameter data, use
"Inherited"
,"Built-in"
,"Bus Object"
,"Enumerated"
,"Expression"
, or"Fixed point"
.For constant data, use
"Built-in"
,"Expression"
, or"Fixed point"
.For data store memory data, use
"Inherited"
.For messages, use
"Inherited"
,"Built-in"
,"Bus Object"
,"Enumerated"
,"Expression"
, or"Fixed point"
.
This property is equivalent to the Mode field of the Data Type Assistant in the Model Explorer and the Data properties dialog box. For more information, see Specify Scope and Type of Stateflow Data.
Name of the Simulink.Bus
object that defines the data object or
message data, specified as a string scalar or character vector. This property applies
only when the Method
property of the data object is "Bus
Object"
. For more information, see Access Bus Signals.
Name of the enumerated type that defines the data object or message data, specified
as a string scalar or character vector. This property applies only when the
Method
property of the data object is
"Enumerated"
. For more information, see Reference Values by Name by Using Enumerated Data.
Expression that evaluates to the data type of the data object or message data,
specified as a string scalar or character vector. This property applies only when the
Method
property of the data object is
"Expression"
. For more information, see Specify Data Properties by Using MATLAB Expressions.
Signedness, specified as a numeric or logical 1 (true
) or 0
(false
). This property applies only when the
Method
property of the data object is "Fixed
point"
. For more information, see Fixed-Point Data in Stateflow Charts.
Word length, in bits, specified as a string scalar or character vector. This
property applies only when the Method
property of the data object
is "Fixed point"
. For more information, see Fixed-Point Data in Stateflow Charts.
Fixed-point properties, specified as a Stateflow.FixptType
object with these properties:
ScalingMode
— Method for scaling the fixed-point data object or message data, specified as"Binary point"
,"Slope and bias"
, or"None"
.FractionLength
— Fraction length, in bits, specified as a string scalar or character vector. This property applies only when theScalingMode
property is"Binary point"
.Slope
— Slope, specified as a string scalar or character vector. This property applies only when theScalingMode
property is"Slope and bias"
.Bias
— Bias, specified as a string scalar or character vector. This property applies only when theScalingMode
property is"Slope and bias"
.Lock
— Whether to prevent replacement of the fixed-point type with an autoscaled type chosen by the Fixed-Point Tool (Fixed-Point Designer), specified as a numeric or logical 1 (true
) or 0 (false
).
This property applies only when the Method
property
of the data object is "Fixed point"
. For more information, see Fixed-Point Data in Stateflow Charts.
Examples
Access the Stateflow.Props
, Stateflow.DataType
, and Stateflow.FixptType
objects for the Stateflow.Data
object x
.
properties = x.Props; type = properties.Type; fixpt = type.Fixpt;
Specify the fixed-point properties.
type.Method = "Fixed point"; type.Signed = true; type.WordLength = "5"; fixpt.ScalingMode = "Binary point"; fixpt.FractionLength = "2";
Verify the data type.
x.DataType
ans = 'fixdt(1,5,2)'
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)