Regardless, here's a solution that *won't work for every dataset*, but I
think will work in your case.
% first derivative (kind of)
dx = diff(vvl);
% second derivative (kind of)
dxx = diff([0,dx]);
% peaks (peaks = -2, troughs = 2)
idx = find(dxx == -2);
% now get the peak vvl values & corresponding x values
vvl(idx)
x(idx)
I tested this with a very simple dataset and it worked, but can't guarantee
it will always work. In particular, if the peak is something like this:
[1,2,3,3,3,2,1], this code will not identify it. Looking at the plot you
sent me, it
should be ok.
Andrew
Sorry, I can't get this to work but is there something in octave similar to Matlab's
pks = findpeaks(data)
[pks,locs]
= findpeaks(data) returns the
indices of the local peaks.
If I can get this, then my problem is solved.
Thanks
Asha