title: Error using interp2 in MATLAB
body: <p>I have a 2D matrix, F, which I want to interpolate with <code>interp2</code>. To understand how this function works, I have been trying to execute the following line:</p>
  
  <pre><code>Fq = interp2(X,Z,F,X,Z);
  </code></pre>
  
  <p>where X and Z are the axes of F after being processed with <code>meshgrid</code>. I thought Fq was going to be equal to F, as I am trying to interpolate with the same axes X and Z.</p>
  
  <p>However, I have been given this output:</p>
  
  <pre><code>Error using griddedInterpolant
  The grid vectors do not define a grid of points that match the given values.
  </code></pre>
  
  <p>Why am I getting that error?</p>
  
  <p>For your information, these are the results of running the function <code>size</code> on X, Z and F:</p>
  
  <pre><code>&gt;&gt; size(X)
  
  ans =
  
     109    24
  
  &gt;&gt; size(Z)
  
  ans =
  
     109    24
  
  &gt;&gt; size(F)
  
  ans =
  
      24   109
  </code></pre>
  
  <p>Thank you.</p>