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

    %% Plot Directivity of 11-Element ULA of Cosine Pattern Antennas
% This example shows how to construct an 11-element ULA of
% cosine antenna elements that are spaced one-half wavelength apart.
% Then, using the |plotResponse| method, plot an azimuth cut of the
% array's directivity by setting the |'Unit'| parameter to |'dbi'|.
% Assume the operating frequency is 1.5 GHz and the wave propagation speed
% is the speed of light.

% Copyright 2015 The MathWorks, Inc.

fc = 1.5e9;
c = physconst('Lightspeed');
lambda = c/fc;
sCos = phased.CosineAntennaElement('FrequencyRange',...
    [1e9 2e9],'CosinePower',[2.5,3.5]);
sULA = phased.ULA(11,0.5*lambda,'Element',sCos);
plotResponse(sULA,fc,c,'RespCut','Az','Unit','dbi');