MATLAB: Divide table in days and then in hours.

divide table

Hello everyone! I'm not very practical with matlab, so I hope that someone can help me. I have a big table [351496 x 5] that it contains 6 months of monitoring. Below the first five rows of my table.
The first column is the categorical variable (they are the name of my PIR sensors) the last column (ColumnDateTime) is the date time array. I want to divide my table for days, so as to create daily subtables. then, every daily subtable I would divide it by hours, creating 4 additional tables (which correspond to the times of the day: morning, afternoon, evening, night). Then I would like to analyze if there are 2 PIR sensors that detect movements in two different rooms (the different rooms are recognized in the first column, through the names of the sensors) in a time <= to 2 seconds. Thanks in advance.

Best Answer

Hi,
if you use a timetable for storing your data the function that might help you is
retime
With this function you can aggregate your data among other things. There are also examples given on the retime documentation site.
Best regards
Stephan