Documentation

Single-Precision Design for MATLAB Code

Convert double-precision MATLAB code to single-precision MATLAB code

Because single precision numbers use only 32 bits, they require less memory than double-precision numbers while still offering many of the benefits of floating point arithmetic. You can convert your double-precision MATLAB code to single-precision using the convertToSingle function at the command line.

Functions

convertToSingleConvert double-precision MATLAB code to single-precision MATLAB code
coder.configCreate configuration object for fixed-point or single-precision conversion

Classes

coder.SingleConfigDouble-precision to single-precision conversion configuration object

Examples and How To

Generate Single-Precision MATLAB Code

Generate single-precision MATLAB® code from double-precision MATLAB code.

Concepts

MATLAB Language Features Supported for Single-Precision Conversion

For single-precision conversion, use supported MATLAB language features.

Single-Precision Conversion Best Practices

Generate single-precision MATLAB code or single-precision C/C++ code according to best practices.

Was this topic helpful?