n=10;
center = [2 ,2];
radius = 10;
angle = 2*pi*rand(n,1);
r = radius*sqrt(rand(n,1));
X = r.*cos(angle)+ center(1);
Y = r.*sin(angle)+ center(2);
plot(X,Y,'.r')
hold on
R = 1. ;
th = linspace(0,2*pi) ;
for i = 1:length(X)
x = R*cos(th)+X(i) ;
y = R*sin(th)+Y(i) ;
plot(x,y,'b')
end
hold on
center = [2 ,2];
radius = 10;
angle = 0:.01:2*pi;
r = radius;
X = r.*cos(angle)+ center(1);
Y = r.*sin(angle)+ center(2);
plot(X,Y,'.b')
Best Answer