Minimum distance between 2 points

11 ビュー (過去 30 日間)
AkB
AkB 2023 年 6 月 5 日
回答済み: Matt J 2023 年 6 月 5 日
I have 10 points distributed randomly. The x-coordinates and y-coordinates of the points are X=rand(1,10) and Y=rand(1,10). I need to calculate the minimum distance between any 2 points, i.e. distance between (Xi, Yi) and (Xj, Yj) , i=1,2,...10 and j=1,2,..10 (except values corresponding to i). Please suggest.

回答 (1 件)

Matt J
Matt J 2023 年 6 月 5 日
Use pdist2

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by