title: How to change an image from Cartesian to Polar coordinates in Matlab?
body: <p>I am trying to convert the pixels of an image from x-y coordinate to polar coordinate and I have problem with it, as I want to code the function by myself. 
  Here is the code I did so far:</p>
  
  <pre><code>function [ newImage ] = PolarCartRot
  % read and show the image
  image= imread('1.jpg');
  %%imshow(image);
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %change to polar coordinate
  [x y z]= size(image);
  r = sqrt(x*x+y*y);
  theta = atan2(y,x);
  for i =0:r
      for j= 0:theta
  newpixel = [i; j];
  newImage(newpixel(1), newpixel(2),:) = image(i,j,:);
      end
  end
  figure;
  imshow (newImage);
  </code></pre>