islocalmax
Find local maxima
Syntax
Description
returns a logical array whose elements are 1 (TF
= islocalmax(A
)true
) when a local
maximum is detected in the corresponding element of A
.
You can use islocalmax
functionality interactively by adding
the Find Local
Extrema task to a live script.
specifies parameters in addition to any of the input argument combinations in
previous syntaxes for finding local maxima using one or more name-value arguments.
For example, TF
= islocalmax(___,Name,Value
)islocalmax(A,'SamplePoints',t)
finds local maxima of
A
with respect to the time stamps contained in the time
vector t
.
[
also returns the prominence corresponding to each element of TF
,P
] = islocalmax(___)A
.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Algorithms
islocalmax
identifies all local maxima (or peaks) in the input
data and follows these steps to compute the prominence of each local maximum. The
prominence of a local maximum measures how the peak stands out with respect to its
height and location relative to other peaks.
Draw a horizontal line to the left and right from the current peak. Stop drawing each segment of the horizontal line when it reaches the edge of the data or intersects the data.
Identify the valleys under the horizontal line.
Use the highest of those valleys as the basis value. The prominence is the absolute difference between the height of the current local maximum and the basis value.
Alternative Functionality
Live Editor Task
You can use islocalmax
functionality interactively by adding
the Find Local
Extrema task to a live script.