How to randomly generate 10 user locations from a two base stations

1 view (last 30 days)
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

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!