Simulink.NumericType
指定浮点数、整数或定点数据类型
说明
使用 Simulink.NumericType
对象设置和共享模型中的信号、状态和参数数据的数值数据类型。
在 MATLAB® 基础工作区、模型工作区或数据字典中创建此类的实例。要在模型工作区中创建数值类型,必须清除是别名属性。
设置对象的属性以创建自定义浮点、整数或定点数据类型。
将数据类型赋给要支持该数据类型的模型的所有信号和参数。
以这种方式赋予数据类型可让您通过更改描述对象的属性来更改模型中信号和参数的数据类型。您不需要更改模型本身。
要重命名模型中以及从模型中生成的代码中的数据类型(通过生成 typedef
语句),可以使用 Simulink.AliasType
对象。
创建对象
您可以通过多种方式创建 Simulink.NumericType
对象。
描述
typeObj = Simulink.NumericType
返回具有默认属性值的 Simulink.NumericType
对象。
属性
对象函数
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 |
示例
扩展功能
版本历史记录
在 R2006a 之前推出