how can i compute x_e (10x10) for first iteration of n and x_e (10x20) for second iteration of n?
1 次查看(过去 30 天)
显示 更早的评论
clc
clear all
close all
L=12; % IRS
element=10;
lambda=0.06;
l=lambda/2;
a_db=-46;
alpha=db2pow(a_db);
K=4;
radius=15;
X0=0; % x-coordinate of Centre of the circle
Y0=0; % y-coordinate of centre of circle
%% Users
t = 2*pi*rand(K,1);
R = radius*sqrt(rand(K,1));
x_u = X0 + R.*cos(t); % X-coordinate of the Users
y_u = Y0 + R.*sin(t); % Y-coordinate of the Users
%% Base stations
x_b=[0.7298; 3; -5.23; 11.86]; % x coordinates of base station
y_b=[12.48; -1.497; -6.139; -3.23]; %y coordiantes of base station
%% IRSs placement
X3=[-7.655; -6.189; -3.251; 2.926; 6.534; 10.79; 5.203; -4.465; 1.42; -8.66; -0.8748; 6.534] ;
Y3=[1.393; 10.42; 6.639; 5.821; 8.425; 2.924; 1.139; 0.7508; -7.917; -6.928; -10.01; -7.03];
p=0;
%% loop for the elements of irs
N=100:100:200;
NN = length(N) ;
for n = 1:length(N)
nn=N(n);
for i=1:L
for j=1:element
for k=1:(nn)/(10)
x3(j,k,i) = X3(i,1) + p;
y3(j,k,i) = Y3(i,1);
p=k*l; % Each time lambda is added to the x-coordinate
x_e(j,k,i,n) = x3(j,k,i); % X coordinate of an element of IRS for plotting
y_e(j,k,i,n)= y3(j,k,i); % Y coordinate of an element of IRS for plotting
end
p=0;
Y3(i,1) = Y3(i,1) + l;
end
% plot(x3,y3,'bo','HandleVisibility','off')
end
end
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!