How to find the best point (of intersection) of 3 contour lines?
11 次查看(过去 30 天)
显示 更早的评论
I have made 3 contour maps using the values in data file attached. The 3 contour lines, with values 7.54, 42.38 and 33.46 (as shown in the plot), are intersecting with each other but not altogether. Is there a way to find a common point (with x-y coordinates) which can be called as the intersection of these 3 lines? Your help will be much appreciated. Thank you
load data
contourf(x1,y1,z1, [900 7.54] ,'ShowText','on',FaceAlpha=0.2,EdgeAlpha=0.5,EdgeColor='r');
% 900 value I have input as a dummy value, as when I use only one value, it
% does not show correct contour.
hold on
contourf(x1,y1,z2, [900 42.38] ,'ShowText','on',FaceAlpha=0.2,EdgeAlpha=0.5,EdgeColor='g');
contourf(x1,y1,z3, [900 33.46] ,'ShowText','on',FaceAlpha=0.2,EdgeAlpha=0.5,EdgeColor='b');
grid on
plot(114,135,'x','color','r') % this point is only for demonstration
3 个评论
John D'Errico
2023-6-8
编辑:John D'Errico
2023-6-8
There is no "best" point. Only you can define that. And once you do define what "best" means, then you can START to find a solution. Until then, best is meaningless. Effectively, you cannot even start to write code until you define what the code should do.
You say you are "aiming along the lines of weighted mean". I'm sorry, but this is still a meaningless statement. A weighted mean of what? Where would weights come from in this context?
There is a set of infinitely many points delineated by those contour lines. That set is not even a simple convex set. Certainly not even a triangular region. It is just a region in the plane. Any point inside that region could arguably be identified as best.
And for example, you might pick the centroid of the region. But if a region is not convex, then the centroid need not even be inside the region. (Consider a U-shaped region, and it need not even be that dramatically shaped. Even something that looks like a half moon would qualify as one where the centroid is not contained inside the region itself.)
I'm sorry, but the simplest solution is to just pick the point that makes sense to you. Click with your mouse at a point that makes you happy. That will be as good as any other measure we could offer.
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!