Excel dates into separate variables
显示 更早的评论
Hello There, I have Date Information (MM/DD/YYY format) in excel that i wish to read in matlab as separate vectors. The code i'm using :
time_car = xlsread('Climatology.xls','carls','F:F');
[year_car,month_car,day_car] = datevec(num2str(time_car),'yyyymmdd');
|And the error i keep getting reads: |
Error using dtstr2dtvecmx
Failed on converting date string to date number.
Error in datevec (line 117)
y = dtstr2dtvecmx(t,icu_dtformat);
The exact same code works for the station data from Albuquerque (alb tab i attached file) without any issue. Any help would be appreciated. Thank you,
采纳的回答
更多回答(1 个)
KSSV
2018-1-23
[num,txt,raw] = xlsread('Climatology.xls') ;
dates = txt(:,6)
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!