Error in conversion of dates to empty year vectors.
2 views (last 30 days)
Show older comments
Hello,
I'm VERY new to coding in MatLab.
I am trying to create a time series to compare two data sets.
I'm stuck on my second data set and wonder if anyone may offer me some advice.
The dates for my sample point are in the top row of an excel file, with count number in each column which I want to sum for each date cumulatively for the time series.
I've made a storage space for each year, with 365 zeros. I'm trying to convert the dates so that they fill in the appropriate zeros in the storage space.
[num, txt, raw] = xlsread(filename,'B1:Z1');
TSP_Dates = txt;
% Convert to Day of Year
date_components = datevec(TSP_Dates,'dd/mm/yyyy');
day_1_TSP_Dates = date_components;
day_1_TSP_Dates(:,2:3)= 1;
day_of_year = datenum(date_components) - datenum(day_1_TSP_Dates)+1;
It keeps getting stuck on the conversion to the day of the year, and giving me this message
Error using dtstr2dtvecmx Failed on converting date string to date number.
Error in datevec (line 117) y = dtstr2dtvecmx(t,icu_dtformat);
Error in SmithPeriodDataTrial (line 29) date_components = datevec(TSP_Dates,'dd/mm/yyyy');
Does any one have any suggestions or advice? I'm very new to all of this.
Thank you for any help! :)
0 Comments
Answers (0)
See Also
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!