MATLAB: How to change data from 10 minutes to hour

#convert #hour #minutes

I have data
x =
01/02/2015 02:20 4
02/02/2015 2:30 2
01/02/2015 02:50 0
01/02/2015 08:50 8
01/02/2015 03:00 7
01/02/2015 03:10 9
02/02/2015 3:30 4
02/02/2015 3:40 6
02/02/2015 03:50 8
the first step I want to normalize starts from the initial hour (2:00)
and generate data per 10 minutes with empty data filled with Nan
the second step I want to change it to average data per hour … so that i get hourly data on each date …
I have tried many times but this doesn't work ..
I thank all those who gave advice and were kind enough to help me.

Best Answer

In R2016b:
T = readtable('data.txt','ReadVariableNames',false,'Format','%q %q %f');
TT = sortrows(timetable(T.Var3,'RowTimes',...
datetime(strcat(T.Var1,'_',T.Var2),'I','dd/MM/uuuu_HH:mm')));
dt = dateshift(TT.Time(1),'start','hour'):...
minutes(10):dateshift(TT.Time(end),'end','hour');
TT1 = retime(TT,dt);% data per 10 minutes
TT2 = retime(TT,'hourly','mean');% average data per hour