Find local extrema places and values
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 (2026). Find local extrema places and values (https://se.mathworks.com/matlabcentral/fileexchange/40007-find-local-extrema-places-and-values), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
