Find local extrema places and values

Returns structure with local extrema (minimum, maximum) places and values.
531 Downloads
Updated 25 Jan 2013

View License

Returns structure with local extrema (minimum, maximum) places and values.

Elements of output structure:
minx: min places
miny: min values
maxx: max places
maxy: max values

Example:

v=[1 3 5 5 2 -2 -2 -1 8 -10 5];
o1=extrems(v)
o2=extrems(v,'ysort')
o3=extrems(v,'strict')

Outputs:
o1 =
minx: [6 10]
miny: [-2 -10]
maxx: [3 9]
maxy: [5 8]
o2 =
minx: [10 6]
miny: [-10 -2]
maxx: [9 3]
maxy: [8 5]
o3 =
minx: 10
miny: -10
maxx: 9
maxy: 8

Cite As

Peter Csordas (2024). Find local extrema places and values (https://www.mathworks.com/matlabcentral/fileexchange/40007-find-local-extrema-places-and-values), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0