How to randomly generate 10 user locations from a two base stations
조회 수: 1 (최근 30일)
이전 댓글 표시
Let's say we have two base stations, the distance between them is 1200 meters, the users are located around them in a distance ranging from 300-600 meters. I need to locate 10 users among those two base stations in a 300-600 distance and I wrote the code below for that purpose. However, this code randomly-allocates the users but doesn't consider that the distance (Euclidian distance if I am right) should be between 600-1800 meters from BS1, nor it gives its exact distance from BS1 (located on the left)
NOBS=2; % Number of Base stations
for ZZ=1:NOBS
NOU=10; % number of users
d=randi([300 600],NOU,1); % generating 10 BS- UE distances ranging from 300 to 600 meters
end
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!