I've been trying to implement quite a complicated a loop in MATLAB. Basically, in pseudo-code the operation is:
-
Loop through the 1D variable X; if samples X(n+1) - X(n) && X(n+2) - X(n+1) && .. up to X(n+4) - X(n+3) > 10 then mark the first sample where the condition >10 was met as a variable StartPnt1.
-
Then carry on the loop through X from StartPnt1 until X(n+1) - X(n) < 10 and mark as a variable EndPnt1.
And repeat the first loop from EndPnt1. BUT if a new StartPnt condition is met within 5 indexes after EndPnt then it does not count. Else, create a new variable StartPnt2 and EndPnt2 if conditions met after 5 indexes.
Aucun commentaire:
Enregistrer un commentaire