for i=1:n
x=100*rand(1,i);
y=100*rand(1,i); end
d=sqrt((0-x).^2+(0-y).^2);
disp(d)
NP =(min(d)); %how to get coordinates of this
FP =(max(d)); %and this
plot(x,y,'b*')
hold on
how could i get the coordinates of the nearest point (NP) and farthest point (FP)?
Best Answer