This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Code Generation for Character Arrays

The code generator translates the 16-bit Unicode® encoding of a character in MATLAB® to an 8-bit encoding that the locale setting determines. The code generator does not support characters that require more than 1 byte in MATLAB. This restriction applies to character arrays that are passed between MATLAB and the code generator. For example, the restriction applies to entry-point function inputs and to outputs from extrinsic calls. For code generation, some MATLAB functions accept only 7-bit ASCII characters. See Functions and Objects Supported for C/C++ Code Generation — Alphabetical List.

If a character is not in the 7-bit ASCII codeset, casting the character to a numeric type, such as double, produces a different result in the generated code than in MATLAB. A best practice for code generation is to avoid performing arithmetic with characters.

Related Topics

Was this topic helpful?