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

    %% Plot pattern of disk array
% Construct a 24-element disk array using elements with two different
% types of cosine antennas. Then, plot the array pattern.
%% Create the array
% The array consists of cosine antenna elements with different power
% exponents.

% Copyright 2015 The MathWorks, Inc.

sElement1 = phased.CosineAntennaElement('CosinePower',1.5);
sElement2 = phased.CosineAntennaElement('CosinePower',1.8);
N = 8;
azang = (0:N-1)*360/N-180;
p0 = [zeros(1,N);cosd(azang);sind(azang)];
posn = [0.6*p0, 0.4*p0, 0.2*p0];
sArray1 = phased.HeterogeneousConformalArray(...
    'ElementPosition',posn,...
    'ElementNormal', zeros(2,3*N),...
    'ElementSet',{sElement1,sElement2},...
    'ElementIndices',[1 1 1 1 1 1 1 1,...
    1 1 1 1 1 1 1 1,...
    2 2 2 2 2 2 2 2]);

%% View the disk array
viewArray(sArray1)

%% Plot the power pattern
% Plot the elevation power pattern of this array two different sets of
% element weights. The first set is uniform weights on the elements. The
% second set is a tapered set of weights set by the |Weights| parameter.
% Restrict the plot of the response from -60 to 60 degrees in 0.1 degree
% increments. Assume the operating frequency is 1 GHz and the wave
% propagation speed is the speed of light.
c = physconst('LightSpeed');
fc = 1e9;
wts1 = ones(3*N,1);
wts1 = wts1/sum(abs(wts1));
wts2 = [0.5*ones(N,1); 0.7*ones(N,1); 1*ones(N,1)];
wts2 = wts2/sum(abs(wts2));
pattern(sArray1,fc,0,[-60:0.1:60],'PropagationSpeed',c,...
    'CoordinateSystem','polar',...
    'Type','powerdb','Weights',[wts1,wts2])

%%
% As expected, the tapered weights broaden the mainlobe and
% reduce the sidelobes.