For example, I have a 2000 x 3 table: Column_1: Datetime Column_2: Rain Column_3: Soil Moisture
The actual table has more variables but I plan to get to it once I know how to undergo the coding.
The idea is to append the rows to a new table if they meet these conditions:
1) While rain > 3 and ends when rain < 2 for 2 subsequent days
2) The 1st condition cannot be less than 4 days
I've been trying to code this out but have gone nowhere:
for i = 1:height(ddtable) ii = 0; finaldd(:,:) = []; while ddtable.RAIN > 3 ii = ii + 1; if ii < 4 break elseif ii > 4 finaldd(ddtable); end end end
Best Answer