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
fiConstruct fixed-point numeric object
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
zerosCreate array of all zeros with fixed-point properties
castCast variable to different data type
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


Fixed-Point Conversion Workflows

Learn which fixed-point conversion method best matches your end goal and your level of fixed-point expertise.

Decide Which Workflow is Right for Your Application

Learn the benefits of each conversion workflow to help you decide which one best fits your needs.

Manual Fixed-Point Conversion Workflow

Learn about workflow for manual float-to-fixed conversion.

Manual Fixed-Point Conversion Best Practices

Get from generic MATLAB® code to an efficient fixed-point implementation using manual fixed-point conversion.

手动将浮点 MATLAB 算法转换为定点

将浮点型 MATLAB 算法手动转换为定点类型。

Know When a Function is Supported for Instrumentation and Acceleration

Determine which functions are supported for fixed-point conversion.


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: Data Type Mismatch

Troubleshoot data type mismatch errors.

Resolve Error: Mismatched fimath

Troubleshoot mismatched fimath errors.