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.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Chunru
am 23 Okt. 2021
n = 8;
xy = rand(n, 2);
d = pdist(xy);
D = squareform(d)
[~, idx]= max(D(:));
[i, j] = ind2sub([n n], idx)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Simulation, Tuning, and Visualization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!