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 CenterFile Exchange에서 Statistics 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