Convert char to cell array

4 次查看(过去 30 天)
harsh
harsh 2012-9-11
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 个评论
Walter Roberson
Walter Roberson 2012-9-12
You did not indicate what numeric value you want to have the strings convert to.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by