Find Local Extrema
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.
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
orfind
. Select Find Local Extrema from the suggested command completions.