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.

MATLAB Language Features Supported for Single-Precision Conversion

MATLAB Language Features Supported for Single-Precision Conversion

Single-precision conversion supports the following MATLAB® language features:

  • N-dimensional arrays.

  • Matrix operations, including deletion of rows and columns.

  • Variable-size data. Comparison plotting does not support variable-size data.

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

  • Complex numbers (see Code Generation for Complex Data).

  • Numeric classes (see Supported Variable Types).

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

  • Arithmetic, relational, and logical operators.

  • Local functions.

  • Global variables.

  • Persistent variables.

  • Structures.

  • Characters.

    Single-precision conversion does not support the complete set of Unicode® characters. Characters are restricted to 8 bits of precision in generated code. Many mathematical operations require more than 8 bits of precision. If you intend to convert your MATLAB algorithm to single precision, it is a best practice not to perform arithmetic with characters.

  • MATLAB classes. Single-precision conversion supports:

    • Class properties

    • Constructors

    • Methods

    • Specializations

    It does not support class inheritance or packages.

  • Function calls (see Resolution of Function Calls for Code Generation)

MATLAB Language Features Not Supported for Single-Precision Conversion

Single-precision conversion does not support the following features:

  • Anonymous functions

  • Cell arrays

  • String scalars

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

  • Function handles

  • Java®

  • Nested functions

  • Recursion

  • Sparse matrices

  • try/catch statements

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