MATLAB: Plotting a year by hour

year by hour

I'm attempting to plot a year by date and hour. Someone suggested the following code:
D = datevec(datenum(1992,1,1:1/24:366));
which produces a years worth of data plus one hour, so I've got 01-01-1992, 0:00:00 to 31-12-1992 0:00:00. So I've got 8761 rows of data for my hours, but only 8760 rows of input data. If anyone can point me in the right direction that would be great. Thank you.

Best Answer

Also, you realize 1992 was a leap year? Is that the year your data was taken? If it is for a generic year, why not use:
D2 = datevec(datenum(1993,1,1:1/24:365+23/24)); % makes 8760 rows