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

    %% Pattern of Custom Antenna Over Selected Range of Angles
% Create an custom antenna System object. The user-defined pattern is
% omnidirectional in the azimuth direction and has a cosine pattern in the
% elevation direction. Assume the antenna operates at a frequency of 1 GHz.
% First show the response at boresight. Display the 3-D pattern for a 60 degree range of azimuth and elevation angles
% centered at 0 degrees azimuth and 0 degrees elevation in 0.1 degree increments.

% Copyright 2015 The MathWorks, Inc.


fc = 1e9;
sCust = phased.CustomAntennaElement;
sCust.AzimuthAngles = -180:180;
sCust.ElevationAngles = -90:90;
sCust.RadiationPattern = mag2db(repmat(cosd(sCust.ElevationAngles)',...
    1,numel(sCust.AzimuthAngles)));
resp = step(sCust,fc,[0;0])

%%
% Plot the power pattern for a range of angles.
pattern(sCust,fc,[-30:0.1:30],[-30:0.1:30],...
    'CoordinateSystem','polar',...
    'Type','power')