Main Content

Half-Precision in Simulink

In Simulink® in R2020a, signals and block outputs can now use half-precision as a storage type. The half-precision data type is supported for simulation and code generation for parameters and a subset of blocks.


This feature is under tech preview and should not be used for production code generation. The first time you simulate a model that uses a half-precision data type, the Diagnostic Viewer displays an info message.

Features Supported for Half-Precision

  • Half-precision as a storage type is supported for simulation in Normal and Accelerator modes. It is not supported for Rapid Accelerator mode.

  • Half-precision is supported for C code generation for .ert targets.

    Code generation for .ert targets requires an Embedded Coder® license.

  • In Simulink, the half-precision data type only supports real values. Complex values cannot have a half-precision data type.

Blocks Supported for Half-Precision

To view the blocks that support half precision, at the command line, type


Blocks that support half-precision display an X in the column labeled Half.

See Also

Related Topics