IF I understand your question (try providing a minimal working example next time of what you want to do, below is a sample MWE), the best way to proceed is using interp1 to place your data onto the grid that you want.
The MWE I have below makes up some data, and then does the hourly lookup and averaging that you want. It will be up to you to get it working on your data.
data = 2*rand(1000,1)-1;
data = medfilt2(data,[10,1]);
data_collect_time = ceil(3*rand(1000,1));
data_collect_time(data_collect_time == 1) = 20;
data_collect_time(data_collect_time == 2) = 30;
data_collect_time(data_collect_time == 2) = 60;
time = cumsum(data_collect_time)/60;
We now have a time vector with uneven differences in time. but, importantly, it is monotonic and increasing. Your data might be better organized than this, and it might be in hours, minutes, seconds, etc. Ours is in hours
ok lets show the vector we want to actually measure on
Really, its important to get everything on the same space, and not in MDY format.
end_time = 220;
time_new = start_time:1:end_time;
now the magic, we just interpolate onto a new grid. This does a linear interpolation, so it will 'average' over points if they are closer together than one hour.
data_new = interp1(time,data,time_new,'linear');
Lets plot our data so you can see.
plot(time,data); hold on; plot(time_new,data_new);
So, you can see that (a) your start/stop points are correct, (b) the data appropriately tracks the original data, and averages over nearby points, (c) is now measured every hour exactly.
This is far from all you can do with interp. Go, explore the possibilities!