MATLAB: Converting letters to strings

readtablestringsstruct2tablexlsread

Dear Matlab users
I read some data from an excel file. The column 11 of this file contains
Baa1
Ca
Baa
B
Aaa
and so forth. When I use
raw=xlsread('file.xlsx');
K=raw(:,11)
I get NaN for each element of K. My questions is how to convert column 11 to a column of string variables. Note that my column is of dimension 20000 by 1. Is there a command in Matlab to do that?
Thanks in advance

Best Answer

The documentations says:
[ num, txt, raw ] = xlsread( filespec );
Thus try
[~,~,raw] = xlsread('file.xlsx');
Now, K will contain the column of strings. You could also use the argument, txt, but then the column number might be "shifted" depending on whether there are numerical columns to the left (C<=10).
"column of string variables" do you mean a character array or a cell array of strings?