%% Prominent Minima
% Compute the local minima of a vector of data and their prominence, and then plot them with the data.

x = 1:100;
A = peaks(100);
A = A(50,:);
[TF1,P] = islocalmin(A);
P(TF1)
plot(x,A,x(TF1),A(TF1),'r*')
axis tight

%
% Compute the most prominent minimum in the data by specifying a minimum prominence requirement.

TF2 = islocalmin(A,'MinProminence',2);
plot(x,A,x(TF2),A(TF2),'r*')
axis tight

% Copyright 2012 The MathWorks, Inc.