[英]Findpeaks in 3D (Surf) plot in Matlab
I need to find several (~5) peaks in a 3D surf plot; 我需要在3D冲浪图中找到几个(〜5个)峰; tried imregionalmax but it's giving me too many maximums and I can't find a way to control it.
尝试过imregionalmax,但是它给了我太多的最大值,我找不到控制它的方法。
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. 我猜我需要找到的实际峰值在我的z数组中(x x y),但是findpeaks仅适用于矢量数组。 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 我用于无区域最大值的MCVE是
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)
I am not familiarized with deterministic methods to achieve this, but if you do not find any fast solution, you could use metaheuristics to determine the local maxima of the surface. 我不熟悉确定性方法来实现此目的,但是如果您找不到快速解决方案,则可以使用元启发式方法来确定曲面的局部最大值。
There are a wide range of algorithms, including: 有多种算法,包括:
I think that there is a recent implementation of PSO in MATLAB, check it out: https://es.mathworks.com/help/gads/particleswarm.html 我认为MATLAB中有PSO的最新实现,请查看: https : //es.mathworks.com/help/gads/particleswarm.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.