How to find the local maxima/minima for 3D surf plot with the location of x and y coordinates?
23 次查看(过去 30 天)
显示 更早的评论
Hello. I have a 3D surf plot of an eigenvalue, that depends on both x and y. I wanted to find the values of the local minima/maxima near some specific coordinates, as well as the coordinates themselves at those points. Is it possible to do so? I used to do this in mathematica, but don't know how to do it in matlab. Thanks!
1 个评论
Scout Patel
2022-8-15
If you don't have the Image Processing Toolbox:
[TF1,P] = islocalmax(Array,2,'MinProminence',4);%threshold at 4...change accordingly
P(TF1)
V1 = find(TF1, 3, 'first') % this finds the first 3...change accordingly
[y1,x1]=ind2sub(size(Array),V1)
采纳的回答
Arun Mathamkode
2018-2-1
You can use the imregionalmax function from the Image Processing Toolbox. The following answer will be useful to you. https://www.mathworks.com/matlabcentral/answers/277512-how-to-find-peaks-in-3d-mesh
imregionalmax returns a matrix with ones at the coordinates where there is local maxima present and zeros at all other locations. If you want to find the local maxima near a coordinate, you can select a suitable neighborhood and search for ones in that region.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!