First convert decimal hour dates into serial dates where unity is a day:
serdates = [5.4;5.404;5.408]/24;
Then convert to string with datestr (this is however a cosmetic operation):
datestr(serdates,'HH:MM:SS')
Group observation in 5 minute bins (lb <= x < up):
ymdhms = datevec(serdates);
[~,minbins] = histc(ymdhms(:,5),[0:5:60])
Group then by year, day, month, hour and 5 minute bins:
[untime,~,subs] = unique([ymdhms(:,1:4) minbins*5],'rows')
Accumulate rot:
rot5min = accumarray(subs,[0.22;0.123;0.129]);
And for fancier presentation collect into dataset with datestrings
dataset({ cellstr(datestr(datenum([untime,zeros(size(untime,1),1)]),31)),'Datetime'}, {rot5min 'ROT5min'})
ans =
Datetime ROT5min
'0000-01-00 05:05:00' 0.472