Main Content

MATLAB 中的手动定点转换

辅助浮点算法转换为定点算法

使用 buildInstrumentedMex 函数来对算法进行插桩,以记录所有命名变量和中间变量的最小值和最大值。使用 showInstrumentationResults 函数根据这些记录的值建议定点数据类型。

函数

全部展开

buildInstrumentedMexGenerate compiled C code function including logging instrumentation
showInstrumentationResultsResults logged by instrumented, compiled C code function
clearInstrumentationResultsClear results logged by instrumented, compiled C code function
fi构造定点数值对象
fimathSet fixed-point math settings
numerictypeConstruct an embedded.numerictype object describing fixed-point or floating-point data type
eyeCreate identity matrix with fixed-point properties
onesCreate array of all ones with fixed-point properties
zeros创建具有定点属性的全零数组
cast将变量转换为不同数据类型
cast64BitFiToIntCast fi object types that can be exactly represented to a 64-bit integer data type
cast64BitIntToFiCast 64-bit integer types to an equivalent fi object type
castFiToIntCast fi object to equivalent integer data type
castFiToMATLABCast fi object type to an equivalent built-in MATLAB data type
castIntToFiCast an integer data type to equivalent fi type

主题

疑难解答

Resolve Error: Function is not Supported for Fixed-Point Conversion

Troubleshoot functions that are not supported for fixed-point conversion.

Resolve Error: fi*non-fi

Troubleshoot fi*non-fi errors.

解决错误:数据类型不匹配

对数据类型不匹配错误进行故障排除。

Resolve Error: Mismatched fimath

Troubleshoot mismatched fimath errors.