Hi Jaydeep
just completed a couple functions that may help with your question
1.
download the functions scatter_points7.m and scatter_points_saturate.m
from
2.
run this
[X,Y,Nmax,Dmatrix]=scatter_points7
3.
key in the menu the rectangle size, the amount of points you want and the minimum distance.
4.
scatter_points7 returns:
X Y coordinates of the random points
Nmax the maximum amount of points that would fit in the rectangle if placing them orderly.
Dmatrix the distances between all combinations of points.
5.
Check the minimum distance requirement is met with
Ap=20;L=combinator(Ap,2,'c');
relD2=((X(L(:,2))-X(L(:,1))).^2+(Y(L(:,2))-Y(L(:,1))).^2).^.5
R0=200;find(relD2<R0)
=
Empty matrix: 1-by-0
or
Ap=20;L2=combinator(Ap,2);
D2=Dmatrix+NaN*eye(Ap);
R0=200;D2(D2<R0)
=
Empty matrix: 0-by-1
.
'
6.
Now try this
[X,Y,Nmax,Dmatrix]=scatter_points_saturate(2000,2000,200)
.
.
to know the amount of points (below Nmax) actually generated
if you find this answer useful would you please be so kind to mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John BG