title: How does nearest neighbor interpolation work in MATLAB?
body: <p>I want to find out how nearest neighbor interpolation works in MATLAB. I have input data :</p>
  
  <pre><code>A = [1 4 7 4 3 6]     % 6 digit vector
  </code></pre>
  
  <p>I use the following MATLAB code :</p>
  
  <pre><code>B = imresize(A,[1 9],'nearest');
  </code></pre>
  
  <p>I get the following result :</p>
  
  <pre><code>[1,4,4,7,4,4,3,6,6]
  </code></pre>
  
  <p>Solving by hand, I get this result :</p>
  
  <pre><code>[1 4 4 7 4 4 3 3 6]
  </code></pre>
  
  <p>Can you please guide me? Am I going wrong somewhere?</p>