FUNCTION REFERENCE

char

Convert character codes to text, or stack text rows.

Convert character codes to text, or stack text rows.

Syntax

s = char(codes)

Syntax

s = char(C)

codes is an array of integers from 0 to 65535 (UTF-16 units); the result keeps its shape. Character input is returned unchanged. A cell array of character rows becomes a character matrix with one row per cell, in column-major order, shorter rows padded with spaces.

Example

char([72 105])   % 'Hi'

Example

char({'a', 'bcd'})   % rows 'a  ' and 'bcd'

Differences from MATLAB: Not checked against MATLAB yet. One input only (use strvcat for several); non-integer and out-of-range codes are rejected.

String inputs are supported with bounded two-dimensional storage.

Example

char(["a" "bbb"])

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.