title: How to find the nearest points to given coordinates with MATLAB?
body: <p>I need to solve a minimization problem with Matlab and I'm wondering which is the easiest solution. All the potential solutions that I've been thinking in require lot of programming effort.</p>
  
  <p>Suppose that I have a lat/long coordinate point (A,B), what I need is to search for the nearest point to this one in a map of lat/lon coordinates.</p>
  
  <p>In particular, the latitude and longitude arrays are two matrices of 2030x1354 elements (1km distance) and the idea is to find the unique indexes in those matrices that minimize the distance to the coordinates (A,B), i.e., to find the closest values to the given coordinates (A,B).</p>
  
  <p>Any help would be very appreciated.</p>
  
  <p>Thanks!</p>