Main Content

Choose a Single-Precision Conversion Workflow

The information in the following table helps you to decide which single-precision workflow to use.

GoalUse
You want to generate single-precision C/C++ code in the most direct way using the codegen function.

codegen with -singleC option. See Generate Single-Precision C Code at the Command Line.

You want to generate single-precision C/C++ code in the most direct way using the MATLAB® Coder™ app.

The MATLAB Coder app with Numeric Conversion set to Convert to single precision. See Generate Single-Precision C Code Using the MATLAB Coder App.

You want to generate only single-precision MATLAB code. You want to see the single-precision MATLAB code or use verification options.

codegen with the -double2single option and a coder.SingleConfig object. See Generate Single-Precision MATLAB Code.

You want to generate single-precision MATLAB code, and then generate single-precision C/C++ code from the single-precision MATLAB code.

codegen with the -double2single option and a coder.SingleConfig object. Also, use the -config object with a code configuration object for the output type that you want. See Generate Single-Precision MATLAB Code.