FUNCTION REFERENCE

cellstr

Convert a character array to a cell array of character vectors.

Convert a character array to a cell array of character vectors.

Syntax

C = cellstr(S)

Each row of the char matrix S becomes one cell, with trailing whitespace

removed; the result is a column. A cell array of character vectors is returned

unchanged. cellstr('') is {''}.

Example

cellstr(vertcat('ab ', 'cd '))   % {'ab'; 'cd'}

String input produces character cells of the same shape, preserving spaces.

Example

cellstr(["a " "b"])

Differences from MATLAB: string storage is two-dimensional and bounded.

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