Find Local Extrema
Find local maxima and minima in the Live Editor
Description
The Find Local Extrema task lets you interactively find local maxima and local minima in data. The task automatically generates MATLAB® code for your live script.
Using this task, you can:
Find local maxima, minima, or both in data from a workspace variable.
Adjust parameters to locate fewer or more extrema.
Visualize the detected extrema.
For more information on Live Editor tasks, see Add Interactive Tasks to a Live Script.
Related Functions
Find Local Extrema generates code that uses the
islocalmin and
islocalmax
functions.
Open the Task
To add the Find Local Extrema task to a live script in the MATLAB Editor:
On the Live Editor tab, select Task > Find Local Extrema.
In a code block in the script, type a relevant keyword, such as
extrema,find,islocalmin, ormax. SelectFind Local Extremafrom the suggested command completions. For some keywords, the task automatically updates one or more corresponding parameters.


