title: Longitude, latitude, and distance in Matlab
body: <p>My matrix, datamat, has X-Y coordinates:</p>
  
  <pre><code>-80.26 40.11
  -80.44 40.24
  -80.29 40.49
  -80.45 40.48
  -80.55 40.90
  -80.32 40.19
  </code></pre>
  
  <p>I have to calculate the distances for all pairs, the number of which is 6*5/2=15. The distance is simply sqrt((x_i-x_j)^2+(y_i-y_j)^2). How do I create a vector that stores those fifteen distance values? Thanks.</p>