Finding closest point to known coordinates

1 回表示 (過去 30 日間)
Mehmet Volkan Ozdogan
Mehmet Volkan Ozdogan 2019 年 3 月 20 日
コメント済み: Star Strider 2019 年 3 月 21 日
Hi,
I want to find a coordinate which has minimum distance to other coordinates,
For example;
I want to find a coordinate (a,b) which has minimum distance to coordinates given below
x y
1 2
1 4
3 2
4 2
  1 件のコメント
Stephan
Stephan 2019 年 3 月 20 日
euclidian distance?

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2019 年 3 月 20 日
The minimum distance of a set of points is the Centroid (link), defined as the mean of the coordinates of the points:
xy = [1 2
1 4
3 2
4 2];
minDist = mean(xy);
figure
plot(xy(:,1), xy(:,2), 'pg')
hold on
plot(minDist(1), minDist(2), 'rp')
hold off
grid
axis equal
Experiment toi get the result you want.
  6 件のコメント
Mehmet Volkan Ozdogan
Mehmet Volkan Ozdogan 2019 年 3 月 21 日
Thank you again
Sincerely
Star Strider
Star Strider 2019 年 3 月 21 日
As always, my pleasure.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAutomotive についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by