Programming and Data Types    

Converting to a Cell Array of Strings

The cellstr function converts a character array into a cell array of strings. Consider the character array

Each row of the matrix is padded so that all have equal length (in this case, 13 characters).

Now use cellstr to create a column vector of cells, each cell containing one of the strings from the data array.

Note that the cellstr function strips off the blanks that pad the rows of the input string matrix.

The iscellstr function determines if the input argument is a cell array of strings. It returns a logical true (1) in the case of celldata.

Use char to convert back to a standard padded character array.

String/Numeric Conversion

The str2double function converts a cell array of strings to the double-precision values represented by the strings.


 Cell Arrays of Strings String Comparisons