Minimum distance between 2 points

11 vues (au cours des 30 derniers jours)
AkB
AkB le 5 Juin 2023
Réponse apportée : Matt J le 5 Juin 2023
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.

Réponses (1)

Matt J
Matt J le 5 Juin 2023
Use pdist2

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by