www.gusucode.com > phased 案例源码 matlab代码程序 > phased/CustomAntennaArrayExample.m
%% Custom Antenna Array % This example shows how to construct and visualize a custom-geometry array % containing antenna elements with a custom radiation pattern. The % radiation pattern of each element is constant over each azimuth angle and % has a cosine pattern for the elevation angles. %% % Define the custom antenna element and plot its radiation pattern. %% az = -180:180; el = -90:90; fc = 3e8; elresp = cosd(el); antenna = phased.CustomAntennaElement('AzimuthAngles',az,... 'ElevationAngles',el,... 'RadiationPattern',repmat(elresp',1,numel(az))); pattern(antenna,3e8,0,el,'CoordinateSystem','polar','Type','powerdb',... 'Normalize',true); %% % Define the locations and normal directions of the elements. All elements % lie in the z-plane. The elements are located at _(1;0;0)_ , % _(0;1;0)_, and _(0;-1;0)_ meters. The element normal azimuth angles are % 0°, 120°, and -120°, respectively. All normal elevation % angles are 0°. xpos = [1 0 0]; ypos = [0 1 -1]; zpos = [0 0 0]; normal_az = [0 120 -120]; normal_el = [0 0 0]; %% % Define a conformal array with those elements. array = phased.ConformalArray('Element',antenna,... 'ElementPosition',[xpos; ypos; zpos],... 'ElementNormal',[normal_az; normal_el]); %% % Plot the positions and normal directions of the elements. viewArray(array,'ShowNormals',true) view(0,90) %% % pattern(array,fc,az,el,'CoordinateSystem','polar','Type','powerdb',... 'Normalize',true,'PropagationSpeed',physconst('LightSpeed'))