I thank you so much for providing this code. Implementation has its own challenges but your code worked like a charm to show how beautifully theory and practice meet. With good initial estimates, the algorithm converged in only a few iterations.
FYI: I used it for T1 estimation in MR where the equations in our case were much more complicated than single exponential recovery equations.
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() ]
I am not sure I understand your question thoroughly but here is what you can do for transparency:
% Filled object becomes more and more transparent as the following variable [transp] goes to zero. [Max value is 1]
transp = 0.5;