www.gusucode.com > phased 案例源码 matlab代码程序 > phased/ConversionofRadiationPatternUsingSpecificPhiThetaValuesExample.m
%% Convert Radiation Pattern For Specific Phi/Theta Values % Convert a radiation pattern to $\phi/\theta$ space with $\phi$ and $\theta$ angles spaced % 5 degrees apart. % Copyright 2015 The MathWorks, Inc. %% % The radiation pattern is the cosine of the elevation. az = -180:180; el = -90:90; pat_azel = repmat(cosd(el)',1,numel(az)); %% % Define the set of $\phi$ and $\theta$ angles at which to sample the pattern. Then, % convert the pattern. phi = 0:5:360; theta = 0:5:180; pat_phitheta = azel2phithetapat(pat_azel,az,el,phi,theta); %% % Plot the result. H = surf(phi,theta,mag2db(pat_phitheta)); H.LineStyle = 'none'; xlabel('phi (degrees)'); ylabel('theta (degrees)'); zlabel('Pattern');