How to modify the code to get my desired array?
1 次查看(过去 30 天)
显示 更早的评论
If we keep 10 antennas at equal distance in a circle on XY-Plane, then their coordinates are given by the code given below:
function r=circularArray(N)
radius = 0.5/sind(180/N);
rx = radius*cosd(360*(0:N-1).'/N);
ry = radius*sind(360*(0:N-1).'/N);
r = [rx, ry, zeros(N,1)];
end
Here you just put value of N where N is the number of antennas. So if N=10, then the above code gives:
r =
1.6180 0 0
1.3090 0.9511 0
0.5000 1.5388 0
-0.5000 1.5388 0
-1.3090 0.9511 0
-1.6180 0 0
-1.3090 -0.9511 0
-0.5000 -1.5388 0
0.5000 -1.5388 0
1.3090 -0.9511 0
Now if I want to keep 9 antennas at same equal distance on x and y -axes separatelyi.e., 4 antennas along x-axis and and 4 antennas along y-axis where the inter-antenna distance is same between any two consective antennas and 1 antenna is placed on the origin. Then what change is to be done in the above code to get the desired geometry i.e., L-type geometry instead of circile?
0 个评论
采纳的回答
Torsten
2022-7-14
编辑:Torsten
2022-7-14
N = 9;
d = 0.25;
rx = [(N-1)/2*d:-d:d,zeros(1,(N+1)/2)].';
ry = [zeros(1,(N+1)/2),d:d:(N-1)/2*d].';
r = [rx,ry,zeros(N,1)]
8 个评论
Torsten
2022-7-16
编辑:Torsten
2022-7-16
N = 4;
d = 0.25;
N_on_each_axis = (N-1)/3;
r = zeros(3*N_on_each_axis+1,3);
v = (N_on_each_axis*d:-d:d).';
r(2:N_on_each_axis+1,1) = v;
r(N_on_each_axis+2:2*N_on_each_axis+1,2) = v;
r(2*N_on_each_axis+2:3*N_on_each_axis+1,3) = v;
r
But you have to make sure that N-1 is divisible by 3 !
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!