I'm working on some solar irradiance data, I have been able to get the hourly average using the following code:
DateNumber = timeStamp(:,1);
formatOut = 'dd mm yyyy HH:MM:SS';
str = datestr(DateNumber,formatOut);
Cell = cellstr(str);
[~,Mth,Day,Hr] = datevec(Cell, 'dd mm yyyy HH:MM:SS');
subs = [Mth Day Hr+1];
hrly_mean_ir = accumarray(subs, I,, @mean);
hrly_mean_ws = accumarray(subs, Ws,, @mean);
hrly_mean_temp = accumarray(subs, T, , @mean);
The problem with this is when I plot it, for example the data for each day should peak around 12pm. But since the average for 1100 to 1200 (or 1200 to 1300 depending on the plot) the peak can be shifted slightly off the midday point.
What I need is the hour to 'start' at 30mins past the hour, eg for 12pm the average would be 1130 to 1230
I'm not too sure how I can get the hourly average in this format however.