i need matlab code for 50 random user locations, 8 Access Points and 1 Base Station on one plane....using m file

2 ビュー (過去 30 日間)
function project() %x= number of user x=50; %y= access point y=8; %z=base station z=2.5;
t1=randn(1,x) t2=randn(1,y)
figure(1) xlabel('x-candidate') ylabel('y-candidate') t=0:0.1:5;
for i=1:x t2=randn(1,x); plot(t1,t,z) grid on
for i =1:x t1=randn(1,y); plot(t2,t,z) grid on end end

採用された回答

sixwwwwww
sixwwwwww 2013 年 12 月 6 日
編集済み: sixwwwwww 2013 年 12 月 6 日
you can do it like this:
figure('Color', 'white')
UserLocationX = randi(50, 1, 50);
UserLocationY = randi(50, 1, 50);
plot(UserLocationX, UserLocationY, '^', 'MarkerSize', 5, 'LineWidth', 3), hold on
AccessPointX = randi(50, 1, 8);
AccessPointY = randi(50, 1, 8);
plot(AccessPointX, AccessPointY, 'go', 'MarkerSize', 5, 'LineWidth', 4), hold on
BaseStationX = 25;
BaseStationY = 25;
plot(BaseStationX, BaseStationY, 'rs', 'MarkerSize', 5, 'LineWidth', 4), hold on, grid on, grid minor
hleg = legend('User Location', 'Access Point', 'Base Station')
set(hleg, 'Location', 'NorthEastOutside')
  1 件のコメント
sara hamdy
sara hamdy 2017 年 8 月 8 日
i need matlab code for 240 random user locations, 7 macro Base Station one base station to each cell and 10 femto base station to each cell ....using m file function []=hex_cell(n, R, x_o, y_o, c)
if ~exist('c','var')
c = 'k';
end
k = 0:(n-1);
x = x_o + R * sin(2*pi*k/n);
y = y_o + R * cos(2*pi*k/n);
xplot = [x, x(1)];
yplot = [y, y(1)];
plot(xplot, yplot, 'color', c)
R = 50 ; n = 6; x_o = 0; y_o = 0;
hex_cell(n, R, x_o, y_o, 'b') axis equal hold on
hex_cell(n, R, x_o - R*sqrt(3), y_o, 'c') hex_cell(n, R, x_o - R*sqrt(3)/2, y_o + 3*R/2, 'g') hex_cell(n, R, x_o - R*sqrt(3)/2, y_o - 3*R/2, 'k')
hex_cell(n, R, x_o + R*sqrt(3), y_o, 'm') hex_cell(n, R, x_o + R*sqrt(3)/2, y_o + 3*R/2, 'r')
hex_cell(n, R, x_o + R*sqrt(3)/2, y_o - 3*R/2, [1 .5 0])
hold off

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

その他の回答 (2 件)

abdulaziz alofui
abdulaziz alofui 2013 年 12 月 6 日
thanks

abdulaziz alofui
abdulaziz alofui 2013 年 12 月 6 日
  4 件のコメント
sixwwwwww
sixwwwwww 2013 年 12 月 6 日
check my updated code above
abdulaziz alofui
abdulaziz alofui 2013 年 12 月 14 日
how can i calculate the distance between user location ,access point and user location ,base station

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

カテゴリ

Help Center および File ExchangeJust for fun についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by