Hey everyone,
I attached the first 50 rows of a sample dataset. My time data is in the format of '2000-01-01 01:00' where the last 5 characters hold the hour (HH) and minute (MM) values respectively. I would like to have a code that goes through the time column, and assigns the maximum value of the second column between the 01,02,03 hours to the 03 hour timestep. I need to then have this done for the 04 – 06 time period and so forth until 22 – 00.
At the end the cell array would not need to keep data from other columns and should just be XXXX x 2 cell array and just reassigns the maximums to the 03,06,09 …… 00 timesteps. There may also be missing hours, so the script would need to accommodate for that.
example:
'1984-01-01 00:00' 10.80 240 20.06 231 0.8'1984-01-01 01:00' 11.83 230 20.06 6 0.6'1984-01-01 02:00' 11.31 230 18.51 100 0.6'1984-01-01 03:00' 10.80 230 18.51 212 0.7'1984-01-01 04:00' 9.77 240 18.65 348 0.8'1984-01-01 05:00' 9.25 240 16.97 406 0.8'1984-01-01 06:00' 9.77 230 17.48 524 0.7'1984-01-01 07:00' 9.77 230 16.97 612 0.7
would then become:
'1984-01-01 03:00' 11.83 '1984-01-01 06:00' 9.77
I am completely lost in writing this and any help would be appreciated!
Best Answer