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

    %% Convert Radiation Pattern For Specific Azimuth/Elevation Values  
% Convert a radiation pattern from phi/theta coordinates to
% azimuth/elevation coordinates, with the azimuth
% and elevation angles spaced $5^{\circ}$ apart.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Define the pattern in terms of phi and theta. 
phi = 0:360;
theta = 0:180;
pat_phitheta = mag2db(repmat(cosd(theta)',1,numel(phi)));  

%% 
% Define the set of azimuth and elevation angles at which to sample the
% pattern. Then, convert the pattern. 
az = -180:5:180;
el = -90:5:90;
pat_azel = phitheta2azelpat(pat_phitheta,phi,theta,az,el);  

%% 
% Plot the radiation pattern. 
H = surf(az,el,pat_azel);
H.LineStyle = 'none';
xlabel('Azimuth (degrees)');
ylabel('Elevation (degrees)');
zlabel('Pattern');