This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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.


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


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.


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.