MATLAB: How to find one cell’s index with respect to another cell

cell

Hi, I have two cells storing Time data. T1 is like
{'1/1/2017 0:00'; '1/1/2017 0:05'; ... ;'1/31/2017 23:55'}
T2 is
{'1/1/2017 3:00'; '1/1/2017 4:00'; ...; '12/31/2017 23:00'}.
T1 is a 5-minute data, T2 is an hourly data. So, for T1, there would be {'1/1/2017 3:00'; '1/1/2017 3:05'…'1/1/2017 3:55'} locate in T2's {'1/1/2017 3:00'}. So how can I find the index of each T1's sample locate in which sample of T2?
Consider T1 is about 1×100,0000, and T2 is 1×1000, we can only use one for loop, how can I do that?

Best Answer

Consider using timetable() objects and retime() Or apply datetime() to the cell arrays, and then use dateshift(t, 'start', 'hour') on T1, and ismember() against datetime(T2)