title: Resizing an image and preserving the aspect ratio
body: <p>In the <code>imresize</code> documentation <a href="http://www.mathworks.com/help/images/ref/imresize.html" rel="nofollow">here</a>, it mentions the following:</p>
  
  <blockquote>
    <p>B = imresize(A, [numrows numcols]) returns image B that has the number
    of rows and columns specified by [numrows numcols]. Either numrows or
    numcols may be NaN, in which case imresize computes the number of rows
    or columns automatically to preserve the image aspect ratio.</p>
  </blockquote>
  
  <p>In the following part:</p>
  
  <blockquote>
    <p>Either numrows or numcols may be NaN, in which case imresize computes
    the number of rows or columns automatically to preserve the image
    aspect ratio</p>
  </blockquote>
  
  <p>Does the <code>NaN</code> here come after resizing the image, or does it refer to not determining <code>numrows</code> or <code>numcols</code>?</p>
  
  <p>So, if I have an image of size <code>365x147</code> and want to resize it to <code>512x512</code>, would the aspect ratio be preserved having assigned <code>numrows</code> and <code>numcols</code> the value <code>512</code>?</p>
  
  <p>Thanks.</p>