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

    %% Directivity of Heterogeneous Uniform Rectangular Array
% Compute the directivity of a 9-element 3-by-3 heterogeneous URA
% consisting of short-dipole antenna elements. The three elements on the
% middle row are Y-directed while all the remaining elements are
% Z-directed.

% Copyright 2015 The MathWorks, Inc.


%%
% Set the signal frequency to 1 GHz.
c = physconst('LightSpeed');
freq = 1e9;
lambda = c/freq;

%%
% Create the array of short-dipole antenna elements. The elements have frequency ranges from 0
% to 10 GHz.
myElement1 = phased.ShortDipoleAntennaElement(...
    'FrequencyRange',[0 10e9],...
    'AxisDirection','Z');
myElement2 = phased.ShortDipoleAntennaElement(...
    'FrequencyRange',[0 10e9],...
    'AxisDirection','Y');
myArray = phased.HeterogeneousURA(...
    'ElementSet',{myElement1,myElement2},...
    'ElementIndices',[1 1 1; 2 2 2; 1 1 1]);


%%
% Create the steering vector to point to 30 degrees azimuth and compute the
% directivity in the same direction as the steering vector.
ang = [30;0];
w = steervec(getElementPosition(myArray)/lambda,ang);
d = directivity(myArray,freq,ang,'PropagationSpeed',c,...
    'Weights',w)