creating two pairs of data which are apart by a certain distance
이전 댓글 표시
Any idea as to how to create two sets of coordinates whose eucleadian distance from every other coordinate is greater than a certain threshold.
In other words i want to get coordinates which dont have any neighbours within a certain radius
Any suggestions?
채택된 답변
추가 답변 (2개)
Stefan
2012년 5월 8일
0 개 추천
if the data set i very large you have to vectorize the code...
Jan
2012년 5월 8일
Please post more details. Currently this is the most simply solution:
% First set of points:
range = 100;
X = rand(100, 3) * range;
% Second set, all point must have distance > 5
distance = 5;
Y = X + (range + distance);
카테고리
도움말 센터 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!