MATLAB: Creating time vector

intervalstime series

silly question.
how to create time series vector for a period of one specific date(say 2 February 2010) to some specific date(11 November 2010) with an interval of one second, one minute, 1 hour,3 hours etc?

Best Answer

t1 = datetime(2010,02,02);
t2 = datetime(2010,11,11);
t1:seconds(1):t2
t1:minutes(1):t2
t1:hours(1):t2
t1:hours(3):t2