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:
Code:
i = 3;
while i<=32000;
if A(1,i-2)>A(1,i-1); A(1,i-1)<A(1,i);
m_i_n=A(1,i-1);
end
if A(1,i-2)<A(1,i-1); A(1,i-1)>A(1,i);
m_a_x=A(1,i-1);
end
i=i+1;
end
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.