www.gusucode.com > phased 案例源码 matlab代码程序 > phased/LinearSubarrayReplicatedInCustomGridExample.m

    %% Linear Subarray Replicated in a Custom Grid
% This example shows how to arrange copies of a linear subarray in a
% triangular layout.

%%
% Create a 4-element linear array.
antenna = phased.CosineAntennaElement('CosinePower',1);
array = phased.ULA('NumElements',4,'Element',antenna);

%%
% Create a larger array by arranging three copies of the linear array.
% Define the phase centers and normal directions of the three copies
% explicitly.

vertex_ang = [60 180 -60];
vertex = 2*[cosd(vertex_ang); sind(vertex_ang); zeros(1,3)];
subarray_pos = 1/2*[...
   (vertex(:,1)+vertex(:,2)) ...
   (vertex(:,2)+vertex(:,3)) ...
   (vertex(:,3)+vertex(:,1))];
replsubarray = phased.ReplicatedSubarray('Subarray',array,...
   'Layout','Custom',...
   'SubarrayPosition',subarray_pos,...
   'SubarrayNormal',[120 0;-120 0;0 0].');

%%
% Plot the positions of the array elements (blue) and the phase centers (red) of the
% subarrays. The plot is in the _xy_-plane because all the
% _z_-coordinates are zero.

viewArray(replsubarray,'ShowSubarray',[])
hold on
scatter3(subarray_pos(1,:),subarray_pos(2,:),...
   subarray_pos(3,:),'ro')
hold off