Simulink Reference Previous page   Next Page
Simulink.NumericType

Specify a data type

Description

This class lets you specify a data type. To do this, create an instance of this class in the MATLAB workspace and set its properties to the properties of the custom data type. Then assign this data type to all signals and parameters of your model that you want to conform to the data type. Assigning the data type in this way allows you to change the data types of the signals and parameters in your model by changing the properties of the object that describe them. You do not have to change the model itself.

Property Dialog Box

Data type mode
Data type of this numeric type. The options are

Option
Description
Boolean
Same as the MATLAB boolean type.
Double
Same as the MATLAB double type.
Single
Same as the MATLAB single type.
Fixed-point: unspecified scaling
A fixed-point data type with unspecified scaling.
Fixed-point: binary point scaling
A fixed-point data type with binary-point scaling.
Fixed-point: slope and bias scaling
A fixed-point data type with slope and bias scaling.
Selecting a category causes Simulink to disable other controls on the dialog box (see below) that apply to the category and to disable controls that do not apply. Selecting a fixed-point category may, depending on the other dialog box options that you select, cause the model to run only on systems that have a Simulink Fixed Point option installed.
Is alias
If this option is selected, Simulink uses the name of the workspace variable that references this object as the name of the data type. Otherwise, Simulink uses the category of the data type as its name, or, if the category is a fixed-point category, Simulink generates a name that encodes the type's properties, using the encoding specified by the Simulink Fixed Point product.
Header file
Storage class of this parameter. See "Storage Classes of Tunable Parameters" in the Real-Time Workshop documentation for more information.
Description
Description of this data type. This field is intended for use in documenting this data type. Simulink ignores it.

Signed
Specifies whether the data type is signed or unsigned. This option is enabled only for fixed-point data type categories.
Word Length
Word length in bits of the fixed-point data type. This option is enabled only for fixed-point data type categories.

Fraction length
Number of bits to the right of the binary point. This option is enabled only if the data type category is Fixed-point: binary point scaling.

Slope
Slope for slope and bias scaling. This option is enabled only if the data type category is Fixed-point: slope and bias scaling.
Bias
Bias for slope and bias scaling. This option is enabled only if the data type category is Fixed-point: slope and bias scaling.

Properties

Name
Access
Description
Bias
RW
Bias used for slope and bias scaling of a fixed-point data type. This field is intended for use by the Simulink Fixed Point product. (Bias)
DataTypeMode
RW
String that specifies the data type of this numeric type. Valid values are 'Double', 'Boolean', 'Single', 'Fixed-point: unspecified scaling', 'Fixed-point: binary point scaling', and 'Fixed-point: slope and bias scaling'. (Data type mode)
Description
RW
Description of this data type. (Description)
FixedExponent

Exponent used for binary point scaling. This property equals -FractionLength. Setting this property causes Simulink to set the FractionLength and Slope properties accordingly, and vice versa. This property appears only if the data type category is Fixed-point: binary point scaling or Fixed-point: slope and bias scaling.
FractionLength
RW
Integer that specifies the size in bits of the fractional portion of the fixed-point number. This property equals -FixedExponent. Setting this property causes Simulink to set the FixedExponent property accordingly, and vice versa. This field is intended for use by the Simulink Fixed Point product. (Fraction length)
IsAlias
RW
Integer that specifies whether to use the name of this object as the name of the data type that it specifies. Valid values are 1 (yes) or 0 (no). (Is alias)
Signed
RW
Integer that specifies whether this data type is signed or unsigned. Valid values are 1 (yes) or 0 (no). (Signed)
Slope

Slope for slope and bias scaling of fixed-point numbers. This property equals SlopeAdjustmentFactor * 2^FixedExponent. If SlopeAdjustmentFactor is 1.0, Simulink displays the value of this field as 2^SlopeAdjustmentFactor. Otherwise, it displays it as a numeric value. Setting this property causes Simulink to set the FixedExponent and SlopeAdjustmentFactor properties accordingly, and vice versa. This property appears only if Category is Fixed-point: slope and bias scaling. (Slope)
SlopeAdjustmentFactor
RW
Slope for slope and bias scaling of fixed-point numbers. Setting this property causes Simulink to adjust the Slope property accordingly, and vice versa. This property appears only if Category is Fixed-point: slope and bias scaling.
WordLength
RW
Integer that specifies the word size of this data type. This field is intended for use by the Simulink Fixed Point product. This property appears only if Category is Fixed-point. (Word Length)


Previous page  Simulink.MSFcnRunTimeBlock Simulink.Parameter Next page

© 1994-2005 The MathWorks, Inc.