MATLAB: How can i create a time matrix for august with each new cell being 1 hour ahead of the previous one

datenumdatestrtime

I wish to create a matrix beginning on 01/08/2011 at 12am with each following cell being exactly 1 hour later then the previous one. I wish to do this until 31/08/2011 at 11pm.
I tried: t=(datenum([2011,08,1,0,0,0]:[0,0,0,1,0,0]:[2011,08,31,1,0,0]));
but it gave an empty matrix. I have also tried using datestr but haven't figured out how to do what i want so any help would be appreciated.

Best Answer

This works:
ts = datenum('01/08/2011 00:00:00', 'dd/mm/yyyy HH:MM:SS');
te = datenum('31/08/2011 23:00:00', 'dd/mm/yyyy HH:MM:SS');
ti = 1/24; % One-Hour Increments
tv = ts:ti:te;
ck = datevec(tv([1:5 end-4:end])); % Check Results