As mentioned, you should use -data.
Here is an example
x = 0 : 1e-3 : 5*pi;
t = (0 : length(x)-1)*1e-3;
y = sin(x);
[p l] = findpeaks(y);
plot(t,y);hold on
plot(t(l),p,'ko','MarkerFaceColor','g');
[pn ln] = findpeaks(-y);
plot(t(ln),-pn,'ko','MarkerFaceColor','r');
gives

source
share