How to find the center point in this plot?
6 ビュー (過去 30 日間)
古いコメントを表示
Sabarinathan Vadivelu
2013 年 2 月 12 日
コメント済み: Cameron Burgoni
2018 年 4 月 9 日
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!