Thanks for you help but I guess I forgot to mention some important details.
Assume I have a 1x32000 matrix A. It contains all the measured values. I don't know how many cycles were performed, I don't know how many measurements were taken in each cycle either. But I can tell for sure that measurements for each cycle don't have to be "symmetrical" with respect to 0, I mean for example:
1st cycle: -40 -36 -30 -4 0 3 31 38 42
2nd cycle: -41 -37 -29 -18 -3 0 4 32 44
My first concept was something like this:
i = 3;
if A(1,i-2)>A(1,i-1); A(1,i-1)<A(1,i);
if A(1,i-2)<A(1,i-1); A(1,i-1)>A(1,i);
I guess all I need now is a matrix that will let me "catch" all those intermediate values but I don't know what syntax to use.