www.gusucode.com > phased 案例源码 matlab代码程序 > phased/ConvertRadiationPatternUsingSpecificAzimuthElevation1Example.m
%% Convert Radiation Pattern Using Specific Azimuth/Elevation Values % Convert a radiation pattern to azimuth/elevation form, with the angles % spaced 5° apart. %% % Define the pattern in terms of _u_ and _v_. % Because _u_ and _v_ values outside the unit circle are not physical, % set the pattern values in this region to zero. u = -1:0.01:1; v = -1:0.01:1; [u_grid,v_grid] = meshgrid(u,v); pat_uv = sqrt(1 - u_grid.^2 - v_grid.^2); pat_uv(hypot(u_grid,v_grid) >= 1) = 0; %% % Define the set of azimuth and elevation angles at which to sample the % pattern. Then convert the pattern. az = -90:5:90; el = -90:5:90; pat_azel = uv2azelpat(pat_uv,u,v,az,el); %% % Plot the pattern. H = surf(az,el,pat_azel); H.LineStyle = 'none'; xlabel('Azimuth (degrees)') ylabel('Elevation (degrees)') zlabel('Pattern')