Excel dates into separate variables
Show older comments
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,
Accepted Answer
More Answers (1)
KSSV
on 23 Jan 2018
[num,txt,raw] = xlsread('Climatology.xls') ;
dates = txt(:,6)
Categories
Find more on Dates and Time 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!