Originally Posted by

**janvdl** Hey guys

I have the following problem:

My solution so far:

However when I input a vector as follows:

And then it seems to draw only the first circle. Any help is appreciated.

The simple answer is hold('on')/hold('off'), the following seems to work:

Code:

function rv=PlotCircles(r)
rv=[]
theta = linspace(0,2*pi,100);
if nargin == 0
r = 1;
end
for i = 1:length(r)
x = r(i)*cos(theta);
y = r(i)*sin(theta);
plot(x,y)
axis square
r0=max(r);
axis([-(r0+1) (r0+1) -(r0+1) (r0+1)])
hold('on');
end
hold('off');

CB