I have a 399 cities array with LON LAT coordinates (first column for the Longitudes), like the picture below.
How can I calculate the 399×399 matrix with all distances between this 399 cities?
I used pdist and squareform but the result are small number. Am I correct?
D = pdist(XY);Z = squareform(D);
For example, the two first points (-50.3125 -23.3005; -48.9918 -24.6617) have a Euclidean distance between them of 216 km (see picture below).
Thank you!
Best Answer