Main Content

MATLAB Language Features Supported for Automated Fixed-Point Conversion

R2026b

Automated fixed-point conversion tools and workflows in the Fixed-Point Designer™ software do not support all features of the MATLAB® language. For best results, avoid unsupported features of the MATLAB language.

To replace MATLAB functions that do not support fixed-point data types, use coder.float2fixed.skip. (since R2024b) For fixed-point conversion using the DataTypeWorkflow.Converter object, use DataTypeWorkflow.FunctionReplacement to specify replacements for unsupported functions. (since R2025a) In the iterative fixed-point conversion workflow in the Fixed-Point Tool, use the function replacement option to specify replacements for unsupported functions. (since R2026a)

MATLAB Language Features Supported for Automated Fixed-Point Conversion

Fixed-Point Designer supports these MATLAB language features in automated fixed-point conversion workflows:

  • N-dimensional arrays

  • Matrix operations, including deletion of rows and columns

  • Variable-size data (see Generate Code for Variable-Size Arrays (MATLAB Coder)). Range computation for variable-size data is supported via simulation mode only. Variable-size data is not supported for comparison plotting.

  • Subscripting (see Incompatibility with MATLAB in Matrix Indexing Operations for Code Generation (MATLAB Coder))

  • Complex numbers (see Code Generation for Complex Data)

  • Signed and unsigned integer classes (see Integers)

  • Double- and single-precision floating point numbers (see double and single)

  • Boolean variables (see logical)

  • Fixed-point data types

  • Double-precision, single-precision, and integer math

  • Fixed-point arithmetic (see Code Acceleration and Code Generation from MATLAB)

  • Program control statements if, switch, for, while, and break

  • Arithmetic, relational, and logical operators

  • Global variables

  • Persistent variables

  • Function handles

  • Structures, including arrays of structures. Range computation for structures is supported via simulation mode only.

  • Characters

  • Local functions when used outside of a class. Local functions called from inside class definitions are not supported.

  • The complete set of Unicode® characters is not supported for code generation. Characters are restricted to 8 bits of precision in generated code. If you intend to convert your MATLAB algorithm to fixed point, do not perform arithmetic with characters, because many mathematical operations require more than 8 bits of precision.

  • MATLAB classes. Range computation for MATLAB classes is supported via simulation mode only.

    Automated conversion supports:

    • Class properties and constant properties

    • Constructors (including those that use nargin and varargin)

    • Methods

    • Specializations

    • Inheritance from handle, matlab.System, and hdl.BlackBox

    Automated conversion does not support inheritance from user-defined classes or classes defined within namespaces (packages). For more information, see Fixed-Point Code for MATLAB Classes.

  • Function calls

  • Subset of MATLAB toolbox functions (see Functions Supported for Code Acceleration or C Code Generation).

  • Subset of DSP System Toolbox™ System objects.

    The DSP System Toolbox System objects supported for automated conversion are:

MATLAB Language Features Not Supported for Automated Fixed-Point Conversion

Fixed-Point Designer does not support these features in automated fixed-point conversion workflows:

  • Anonymous functions

  • Cell arrays

  • String scalars

  • Objects of value classes as entry-point function inputs or outputs

  • Java®

  • Nested functions

  • Recursion

  • Sparse matrices

  • try/catch statements

  • varargin, varargout, or generation of fewer input or output arguments than an entry-point function defines

  • Dot indexing properties of fixed-point data types.

    Avoid using properties of fixed-point types in MATLAB code being converted.

  • Dynamic field or property references

  • Handle class destructors

  • Arguments blocks

  • Property validation functions

  • Functions that do not support fixed-point data types

  • User-defined System objects that meet these conditions:

    • Implement the releaseImpl method

    • Implement and specialize either the step, setupImpl, stepImpl, resetImpl, or updateImpl methods

See Also

Topics