You did not indicate what numeric value you want to have the strings convert to.
Convert char to cell array
4 次查看(过去 30 天)
显示 更早的评论
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);
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!