Simulink 中的浮点设定
创建和使用浮点数据类型,如单精度和半精度
由于单精度数只使用 32 位,因此它们所需的内存少于双精度数,但仍具有浮点算术的许多优点。半精度数据类型仅占用 16 位内存,但其浮点表示使其能够处理比相同大小的整数或定点数据类型更宽的动态范围。
类
Simulink.NumericType | 指定浮点数、整数或定点数据类型 |
target.FloatingPointDataType | Describe floating point data type implemented by compiler for target hardware (自 R2021b 起) |
函数
ssGetDataTypeIsDoubleSingleorHalf | Determine whether registered data type is double, single, or half-precision data type (自 R2020b 起) |
ssGetDataTypeIsHalfPrecision | Determine whether registered data type is half-precision data type (自 R2020b 起) |
ssRegisterDataTypeHalfPrecision | Register half-precision data type and return its data type ID (自 R2020b 起) |
target.add | Add target object to internal database |
target.create | Create target object |
target.get | Retrieve target objects from internal database |
target.remove | Remove target object from internal database |
命名空间
target | 管理目标硬件和构建工具信息 |
主题
- What is Half Precision?
Introduction to the half-precision data type in MATLAB® and Simulink®.
- The Half-Precision Data Type in Simulink
Simulink software features supported for the half-precision data type.
- Generate Native Half-Precision C Code from Simulink Models
Generate C code for embedded hardware targets that natively supports half precision floating-point data types.