Simulink.NumericType
Specify floating-point, integer, or fixed-point data type
Description
Use a Simulink.NumericType
object to set and share numeric
data types for signal, state, and parameter data in a model.
Create an instance of this class in the MATLAB® base workspace, a model workspace, or a data dictionary. To create a numeric type in a model workspace, you must clear the Is alias property.
Set the properties of the object to create a custom floating point, integer, or fixed point data type.
Assign the data type to all signals and parameters of your model that you want to conform to the data type.
Assigning a 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.
To rename a data type in a model and in the code that you generate from a model (by
generating a typedef
statement), you can use a Simulink.AliasType
object.
Creation
You can create a Simulink.NumericType
object several ways.
Interactively create a
Simulink.NumericType
object using the Type Editor or Model Explorer.Programmatically create a
Simulink.NumericType
object using theSimulink.NumericType
function described here.
Description
typeObj = Simulink.NumericType
returns a
Simulink.NumericType
object with default property
values.
Properties
Object Functions
isboolean | Determine whether numeric type represents the Boolean data type
boolean |
isdouble | Determine whether numeric type represents the double-precision, floating-point
data type double |
isfixed | Determine whether numeric type represents a fixed-point data type |
isfloat | Determine whether numeric type represents a floating-point data type |
isscalingbinarypoint | Determine whether fixed-point numeric type has binary-point scaling |
isscalingslopebias | Determine whether numeric type represents a fixed-point data type with slope-and-bias scaling |
isscalingunspecified | Determine whether numeric type represents a data type with unspecified scaling |
issingle | Determine whether numeric type represents the single-precision, floating-point
data type single |
ishalf | Determine whether numeric type represents the half-precision, floating-point data
type half |
Examples
Extended Capabilities
Version History
Introduced before R2006a