Say if I want to find the decimal day of year I would use:
clear allStartDate = '2011-01-01 00:00';EndDate = '2011-12-31 23:57';Resolution = 60;DateTime=datestr(datenum(StartDate,'yyyy-mm-dd HH:MM'):Resolution/(60*24):... datenum(EndDate,'yyyy-mm-dd HH:MM'),... 'yyyy-mm-dd HH:MM');DateTime=cellstr(DateTime);JDay = cellfun(@(x)datenum(x),DateTime,'un',0);DecDay = cell2mat(cellfun(@(x)x - datenum(2011,0,0),JDay,'un',0));
How is this achieved if the data extends over one year? So, say that my start data remains the same but my end data changes to '2013-12-31 23:57' how would I convert my time series into decimal day of year.
Best Answer