I know this is old but I wanted to note that it can be done easier and faster as follows:
t = 2*pi/N*(1:N);
fill(c(1)+r*cos(t), c(2)+r*sin(t), color);
Also note that you don't need both 0 and 2pi (they are the same polar point). Your code actually generates N+1 points.
[ depending on N, the above can be substantially faster than using linspace() + ones() + pol2cart() ]