Randomly located access points in a given area
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!