M-File Help: peak2 | View code for peak2

# peak2

Find peaks in a matrix

zp = peak2(z, options) are the peak values in the 2-dimensional signal z.

[zp,ij] = peak2(z, options) as above but also returns the indices of the maxima in the matrix z. Use SUB2IND to convert these to row and column coordinates

## Options

'npeaks', N | Number of peaks to return (default all)
'scale', S | Only consider as peaks the largest value in the horizontal and vertical range +/- S points.
'interp' | Interpolate peak (default no interpolation)
'plot' | Display the interpolation polynomial overlaid on the point data

## Notes

- A maxima is defined as an element that larger than its eight neighbours. Edges elements will never be returned as maxima.
- To find minima, use PEAK2(-V).
- The interp options fits points in the neighbourhood about the peak with a paraboloid and its peak position is returned. In this case IJ will be non-integer.

## See also

peak, sub2ind

© 1990-2014 Peter Corke.