Randomly located access points in a given area

6 ビュー (過去 30 日間)
Cladio Andrea
Cladio Andrea 2015 年 1 月 15 日
回答済み: mohammed 2023 年 2 月 13 日
Hello, i have a secenario 40x200m and i want to locate 8 access points and calculate the number inside the circles and then measure the traffic generated in each circles. However, i want to locate access points in a logical random way,, splitting x (200m) axis into 8 parts and then for each 25m. locate one access point randomly. Is there anyone can help me to fix my matlab code please? Here is the code..
AccessPointX = randi(200, 1, 8); AccessPointY = randi(40, 1, 8);
for z=1:8;
xCenter = AccessPointX(z); yCenter = AccessPointY(z);
theta = 0 : 0.01 : 2*pi; radius = 20; x = radius * cos(theta) + xCenter; y = radius * sin(theta) + yCenter; plot(x,y,'y.'); hold on axis square; xlim([0 200]); ylim([0 40]); daspect([1 1 1]) grid on; hold on;
xv = radius * cos(theta) + xCenter; yv = radius * sin(theta) + yCenter; rng default xq = machines(:,1); yq = machines(:,2); xq2 = data(idx_data_it,1)+rand(size(data(idx_data_it,1))); yq2 = data(idx_data_it,2)+rand(size(data(idx_data_it,2))); [in,on] = inpolygon(xq,yq,xv,yv); [in3,on3] = inpolygon(xq2,yq2,xv,yv);
plot(AccessPointX, AccessPointY, 'go', 'MarkerSize', 5, 'LineWidth', 4), hold on
disp('Number of devices inside the cell edge');
numel(xq(in))
end
  1 件のコメント
Image Analyst
Image Analyst 2015 年 1 月 15 日
編集済み: Image Analyst 2015 年 1 月 15 日
Read this and fix the formatting. You can also type control-a control-i in MATLAB in the editor to fix up the indenting.

サインインしてコメントする。

回答 (1 件)

mohammed
mohammed 2023 年 2 月 13 日
Hello all , I have small obstracle in a layout where the access points are have to be placed in different loaction so , can anyone suggest me how to add the access points in a layout.

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by