Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

MATLAB 中的浮点设定

创建和使用浮点数据类型,如单精度和半精度

由于单精度数只使用 32 位,因此它们所需的内存少于双精度数,但仍具有浮点算术的许多优点。半精度数据类型仅占用 16 位内存,但其浮点表示使其能够处理比相同大小的整数或定点数据类型更宽的动态范围。您可以使用 CustomFloat 对象定义具有指定字长和尾数长度的浮点数值数据类型。

Simulink.NumericType指定浮点数、整数或定点数据类型
target.FloatingPointDataTypeDescribe floating point data type implemented by compiler for target hardware (自 R2021b 起)

函数

全部展开

single单精度数组
half构造半精度数值对象
pow10以 10 为底的幂和缩放半精度数
rsqrt平方根倒数
fmaMultiply and add using fused multiply add approach
target.addAdd target object to internal database
target.createCreate target object
target.getRetrieve target objects from internal database
target.removeRemove target object from internal database
CustomFloatNumeric object with a custom floating-point data type (自 R2020a 起)

命名空间

target管理目标硬件和构建工具信息

主题

相关信息