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

    %% Reduced Elevation Pattern of Custom Antenna Element
% Create an antenna with a custom response. The user-defined pattern has a
% sine pattern in the azimuth direction and a cosine pattern in the
% elevation direction. Assume the antenna operates at a frequency of 500
% MHz. Plot an elevation cut of the power of the custom antenna element
% at 0 and 30 degrees elevation. Assume the operating frequency is 500 MHz.

% Copyright 2015 The MathWorks, Inc.


%%
% Create the antenna element.
fc = 500e6;
sCust = phased.CustomAntennaElement;
sCust.AzimuthAngles = -180:180;
sCust.ElevationAngles = -90:90;
sCust.RadiationPattern = mag2db(abs(cosd(sCust.ElevationAngles)'*sind(sCust.AzimuthAngles)));
patternElevation(sCust,fc,[0 30],...
    'Type','powerdb')
%%
% Plot a reduced range of elevation angles using the |Azimuth|
% parameter.
patternElevation(sCust,fc,[0 30],'Elevation',[-45:45],...
    'Type','powerdb')