Convert to cell array of character vectors
C = cellstr(
converts
array S
)S
to a cell array.
If S
is a character array, then
each row of S
is a cell of C
.
The cellstr
function removes trailing whitespace
characters in the rows of S
, except for significant
whitespace such as nonbreaking space characters. Use the char
function
to convert back into a character array.
If S
is a cell array of character
vectors, then cellstr
returns S
unaltered.
If S
is a categorical array, then cellstr
converts
each element to a character vector and assigns it to a cell. The size
of the cell array is the same as the size of S
.
Starting in R2016b, if S
is a string
array, then cellstr
converts each element to a
character vector and assigns it to a cell. The size of the cell array
is the same as the size of S
. Use the string
function
to convert back into a string array.
S = cellstr(
converts
a datetime, duration, or calendar duration array into a cell array
of character vectors in the format specified by the D
)Format
property
of D
. The output has the same dimensions as D
.
S = cellstr(
represents
dates or durations in the specified locale. For example, D
,fmt
,locale
)cellstr(D,'dd-MMM-yyyy','en_US')
represents
the dates associated with each element of D
using
the en_US
locale. The locale affects the language
used to represent character vectors such as month and day names.