just completed a couple functions that may help with your question
download the functions scatter_points7.m and scatter_points_saturate.m
key in the menu the rectangle size, the amount of points you want and the minimum distance.
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.
Check the minimum distance requirement is met with
Empty matrix: 1-by-0
Empty matrix: 0-by-1
Now try this
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