title: Matlab "interp2" problem regarding NaN at edges
body: <p>I am a bit stuck on a simple exercise and would appreciate some help.</p>
  
  <p>I am trying to do some simple 2D interpolation using the "interp2" function in Matlab for a variable 'tmin' of dimension [15x12]:</p>
  
  <pre><code>lat = 15:1.5:32;
  lon = 70:1.5:92;
  
  lat_interp = 15:1:32;
  lon_interp = 70:1:92;
  
  [X,Y]   = meshgrid(lat,lon);
  [Xi,Yi] = meshgrid(lat_interp,lon_interp);
  
  tmin_interp = zeros(length(lon_interp),length(lat_interp),Num_Days);
  tmin_interp(:,:) = interp2(X,Y,tmin(:,:),Xi,Yi,'linear');
  </code></pre>
  
  <p>This code results in the last row and last column of tmin_interp to be NaNs, i.e.:</p>
  
  <pre><code>tmin_interp(23,1:18) ==&gt; NaN
  tmin_interp(1:23,18) ==&gt; NaN
  </code></pre>
  
  <p>Does anyone know what I might be doing wrong? Am I making a simple mistake with regards to the interpolation setup?  Thank you for your time.</p>