How to find the center point in this plot?
10 次查看(过去 30 天)
显示 更早的评论
This is my plot. How to find the center point available in this plot?

4 个评论
采纳的回答
Walter Roberson
2013-2-13
minx = min(x);
maxx = max(x);
centx = (minx + maxx) / 2;
miny = min(y);
maxy = max(y);
centy = (miny + maxy) / 2;
dist2 = (x - centx).^2 + (y - centy).^2;
[mindist2, idx] = min(dist2);
bestx = x(idx);
besty = y(idx);
0 个评论
更多回答(1 个)
Thorsten
2013-2-12
x = rand(1,100);
y = rand(1,100);
plot(x, y, 'r*')
hold on
plot(mean(x), mean(y), 'k*', 'MarkerSize', 20)
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Log Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!