For rows and 2 columns, containing xOy coordinates of the point. Look for the two points with the furthest distance and return the row index of those two points.
조회 수: 2 (최근 30일)
이전 댓글 표시
Please, Can y help me :
For rows and 2 columns, containing xOy coordinates of the point. Look for the two points with the furthest distance and return the row index of those two points.
댓글 수: 0
답변 (1개)
Chunru
2021년 10월 23일
n = 8;
xy = rand(n, 2);
d = pdist(xy);
D = squareform(d)
[~, idx]= max(D(:));
[i, j] = ind2sub([n n], idx)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulation, Tuning, and Visualization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!