Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

sixwwwwww
sixwwwwww am 6 Dez. 2013
Bearbeitet: sixwwwwww am 6 Dez. 2013
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 Kommentar
sara hamdy
sara hamdy am 8 Aug. 2017
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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

abdulaziz alofui
abdulaziz alofui am 6 Dez. 2013
thanks

abdulaziz alofui
abdulaziz alofui am 6 Dez. 2013
  4 Kommentare
abdulaziz alofui
abdulaziz alofui am 14 Dez. 2013
how can i calculate the distance between user location ,access point and user location ,base station

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by