I need to find several (~5) peaks in a 3D surf plot; tried imregionalmax but it's giving me too many maximums and I can't find a way to control it.
I guess the actual peaks I need to find is in my z array which is (x by y), but findpeaks only works for a vector array. Is there an alternative? I've read something about the function squeeze- but not entirely sure how to put it into use it.
The link is an example of the graph and the data points are the examples of the peaks I would need to know.
If anyone could shed some light on this, it'd be great, thanks!
A MCVE I used for imregionalmax is
Z = peaks;
y = linspace(1,100,49);
x = linspace(10,20,49);
[X, Y] = meshgrid(x,y);
figure
surf(X, Y, Z,'EdgeColor','none','FaceColor','interp');
maxZ = imregionalmax(Z);
plot3(X(maxZ),Y(maxZ),Z(maxZ),'r*','MarkerSize',12)