Search all the maxima and minima points (peaks) in a time series (vector) or a surface (matrix), via columns, rows and crossing diagonals, ignoring NaN's elements.
USAGE:
[zmax,imax,zmin,imin]= extrema2(peaks);
where zmax (zmin) are the maxima (minima) elements and imax (imin) their linear index (check IND2SUB).
They come with the examples on the screenshot.
These are the same files as EXTREME.M and EXTREME2.M, but updated. |