Convert char to cell array

1 view (last 30 days)
harsh
harsh on 11 Sep 2012
I am importing a spreadsheet into Matlab that has over 15918 vectors. I have one column, column 3, that has characters populated into each of the rows. These variables are designated as "tag" and "vendorname." These two variables are shown in the variable editor as <15918x1 cell>, I need to convert it to <15918x1 double> for both. How do I do that?
Second, I want to create a GUI that allows me to enter a generic "tag" and a generic "vendorname" that can be found in the database, and produce order date quantity and cost.
Below are the variables I have defined and the script I have used.
tag
tday
vendorname
[num, txt]=xlsread('Valve History.xls');
tday=txt(2:end, 4);
tday=datestr(datenum(tday, 'mm/dd/yyyy'), 'yyyymmdd');
tday=str2double(cellstr(tday));
tag=txt(2:end, 3);
vendorname=txt(2:end, 8);
  1 Comment
Walter Roberson
Walter Roberson on 12 Sep 2012
You did not indicate what numeric value you want to have the strings convert to.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!