I currently am seeking a way to use Matlab to help define a heatwave event at a certain station. For my situation, a heatwave is where the departure from normal for a high or low temperature is in the 95 percentile (a "relaxed" heatwave) or in the 99 percentile (a "strict" heatwave).
I used a .csv file that had daily maximum and minimum temperatures, along with the respective departures. From here I was able to break the data into the time frame I wanted, and then calculate the thresholds. There are four different thresholds -- the minimum and maximum temperature departure in the 95 percentile and the minimum and maximum temperature departure at the 99 percentile.
Currently I have four matrices that have data for each respective threshold. Here is a small portion of the matrix that met the maximum temperature departure threshold (m1):
694158 99 14 64 1
694159 99 13 68 5
694179 98 13 63 1
694180 98 14 74 12
694183 100 16 70 8
The first column represents the serial date number, and the rest of the columns are temperature information (max, max departure, min, min departure).
So here is my question: I cannot find a way to go through the serial date numbers and see if there are three (or more) consecutive days in a row.
The best help I could find online was this mathworks post but the solution wouldn't append any information into a matrix.
If someone could point me in the right direction, or point me towards a resource to help me out, I would highly appreciate it!
Thanks in advance.