On 3/23/2013 12:21 PM, Emmanuel Ndetto wrote: > Hello everyone, > > I would like to create a date vector with with only hours of the day > starting from 06 to 18 but after every 4 hours time interval. > > the starting date may be for example 07-Jan-2012 06:00 and ending on 31 > - Dec- 2015 18:00. > > The hourly intervals should be 4 hours.
doc datenum doc datevec
I can't parse the first sentence but note that you can use a vector of any time interval as input and datenum() is clever enough to convert to the proper calendar time accounting for days of month, leap years, etc., etc., ...
So, an hour vector of [0:4:nHours] where nHours is the number of hours in the overall time span desired is good when combined w/ the start yr,mo,da.