I want to create a vector containing dates in matlab. For this, I indicated the start time and stop time:
WHM01_start = datenum('01-JAN-2005 00:00')
WHM01_stop = datenum('01-SEP-2014 00:00')
and then I created a vector with
WHM01_timevec = WHM01_start:datenum('01-JAN-2014 00:20') - datenum('01-JAN-2014 00:00'):WHM01_stop;
after I want to have time steps of 20 minutes each. Unfortunately, I received a rounding error after several thousand values, which led me to
>> datestr(WHM01_timevec(254160))
ans =
31-Aug-2014 23:39:59
and not as expected, 31-Aug-2014 23:40:00
How can I fix these incorrect values?
Edit: I also saw this stream , but, unfortunately, I get there a vector for the date, and not a number as desired.
source
share