| MATLAB Function Reference | ![]() |
Create cell array of strings from character array
Syntax
c = cellstr(S)
Description
c = cellstr(S)
places each row of the character array S into separate cells of c. Use the char function to convert back to a string matrix.
Examples
S=['abc ';'defg';'hi ']
S =
abc
defg
hi
whos S
Name Size Bytes Class
S 3x4 24 char array
The following command returns a 3-by-1 cell array.
c = cellstr(S)
c =
'abc'
'defg'
'hi'
whos c
Name Size Bytes Class
c 3x1 294 cell array
See Also
| cellplot | cgs | ![]() |