Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
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

Réponse acceptée

sixwwwwww
sixwwwwww le 6 Déc 2013
Modifié(e) : sixwwwwww le 6 Déc 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 commentaire
sara hamdy
sara hamdy le 8 Août 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

Connectez-vous pour commenter.

Plus de réponses (2)

abdulaziz alofui
abdulaziz alofui le 6 Déc 2013
thanks

abdulaziz alofui
abdulaziz alofui le 6 Déc 2013
  4 commentaires
abdulaziz alofui
abdulaziz alofui le 14 Déc 2013
how can i calculate the distance between user location ,access point and user location ,base station

Connectez-vous pour commenter.

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by