title: examples to convert image to polar coordinates do it explicitly - want a slick matrix method
body: <p>I am trying to convert an image from cartesian to polar coordinates.</p>
  
  <p>I know how to do it explicitly using for loops, but I am looking for something more compact.</p>
  
  <p>I want to do something like:</p>
  
  <pre><code>[x y] = size(CartImage);
  minr = floor(min(x,y)/2);
  
  r = linspace(0,minr,minr);
  phi = linspace(0,2*pi,minr);
  
  [r, phi] = ndgrid(r,phi);
  
  PolarImage = CartImage(floor(r.*cos(phi)) + minr, floor(r.sin(phi)) + minr);
  </code></pre>
  
  <p>But this obviously doesn't work.</p>
  
  <p>Basically I want to be able to index the CartImage on a grid.</p>
  
  <p>The polar image would then be defined on the grid.</p>