
194 CHAPTER 7 Clustering
x_coord=10;
for y=mini:step:maxi
X8=[X8; x_coord+noise*(rand-.5) y+noise*(rand-.5)];
end
To generate the third group, type
%Construction of the 3rd cluster (semicircle, center (21,0), R=3;, y<0)
R=3;
x_center=21;
y_center=0;
mini=x_center-R;
maxi=x_center+R;
step=(maxi-mini)/(n_points(3)-1);
for x=mini:step:maxi
y=y_center - sqrt(Rˆ2-(x-x_center)ˆ2)+noise*(rand-.5);
X8=[X8; x y];
end
Finally, to generate the fourth group, type
% Construction of the fourth cluster (archimidis spiral)
asp=0.2;
step=(5*pi)/(n_points(4)-1);
count=0;
x_tot=[];
y_tot=[];
for theta=pi:step:6*pi
count=count+1;
r=asp*theta;
x_tot=[x_tot; r*cos(theta)];
y_tot=[y_tot; r*sin(th ...