单精度转换
将双精度代码转换为单精度代码(需要 Fixed-Point Designer™)
如果您有 Fixed-Point Designer 产品,为了符合目标硬件约束,请生成单精度 C/C++ 代码。
类
coder.SingleConfig | Double-precision to single-precision conversion configuration object |
函数
coder | 打开 MATLAB Coder |
codegen | 从 MATLAB 代码生成 C/C++ 代码。 |
coder.config | 创建 MATLAB Coder 代码生成配置对象 |
主题
- Choose a Single-Precision Conversion Workflow
Generate single-precision C/C++ code or generate single-precision MATLAB® code.
- Generate Single-Precision C Code at the Command Line
Use
codegen
to generate single-precision C code from double-precision MATLAB code. - Generate Single-Precision C Code Using the MATLAB Coder App
Use the app to generate single-precision C code from double-precision MATLAB code.
- Generate Single-Precision MATLAB Code
Generate single-precision MATLAB code from double-precision MATLAB code.
- Single-Precision Conversion Best Practices
Generate single-precision MATLAB code or single-precision C/C++ code according to best practices.
- MATLAB Language Features Supported for Single-Precision Conversion
Use supported MATLAB language features for single-precision conversion.
- Warnings from Conversion to Single-Precision C/C++ Code
Address warnings from single-precision conversion.
- Combining Integers and Double-Precision Numbers
Do not combine integers and double-precision numbers in MATLAB code for conversion to single-precision C/C++ code.