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

    %% Azimuth Pattern of Heterogeneous URA For Two Sets of Weights
% Construct a square 3-by-3 heterogeneous URA composed of 9 short-dipole
% antenna elements with different orientations. Plot the array azimuth
% pattern from -45 degrees to 45 degrees in 0.1 degree increments. The
% |Weights| parameter lets you display the array pattern simultaneously
% for different sets of weights: in this case a uniform set of weights and
% a tapered set.

% Copyright 2015 The MathWorks, Inc.


%%
sElement1 = phased.ShortDipoleAntennaElement(...
    'FrequencyRange',[2e8 5e8],...
    'AxisDirection','Z');
sElement2 = phased.ShortDipoleAntennaElement(...
    'FrequencyRange',[2e8 5e8],...
    'AxisDirection','Y');
sArray = phased.HeterogeneousURA(...
    'ElementSet',{sElement1,sElement2},...
    'ElementIndices',[1 1 1; 2 2 2; 1 1 1]);
fc = [3e8];
c = physconst('LightSpeed');
wts1 = ones(9,1)/9;
wts2 = [.7,.7,.7,.7,1,.7,.7,.7,.7]';
wts2 = wts2/sum(wts2);
pattern(sArray,fc,[-45:0.1:45],0,...
    'PropagationSpeed',c,...
    'CoordinateSystem','rectangular',...
    'Type','powerdb',...
    'Weights',[wts1,wts2],...
    'Polarization','combined')