I have a record of timestamps at 5 minute intervals. I want to calculate the time (ideally in hours) until the next tide change given the indices of the tide changes. I think the first step is to determine the closest upcoming tide change index to each timestamp in the vector (I need to identify the NEXT tide change even if the previous tide change is closer).
I have attached the data here (data.m) where MX (4888x1 double) is my timestamp vector (in matlab time) and flood (32x1 double) identifies the indices of the flood tides starting.
I cannot for the life of me figure out how to translate this problem into Matlab and I'm not sure what to search in the Matlab help section to figure it out either.
Thank you in advance for any help!