#Make the axes equal so the calculated distances correspond to the apparent distances on
the plot axis equal and zoom in to see the neighbors better.
xlim([4.5 5.5]);
ylim([1 2]);
axis square
#Find the species of the 10 neighbors.
tabulate(species(n))
#Using a rule based on the majority vote of the 10 nearest neighbors, you can classify this new point as a versicolor.Visually identify the neighbors by drawing a circle around the group of them. Define the
#center and diameter of a circle, based on the location of the new point.
ctr = newpoint - d(end);
diameter = 2*d(end);
% Draw a circle around the 10 nearest neighbors.
h = rectangle('position',[ctr,diameter,diameter],...
'curvature',[1 1]);
h.LineStyle = ':';
#Using the same dataset, find the 10 nearest neighbors to three new points.