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

    %% Convert Radiation Pattern
% Convert a radiation pattern to azimuth/elevation form with the angles
% spaced 1° 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; 

%%
% Convert the pattern to azimuth/elevation space.
pat_azel = uv2azelpat(pat_uv,u,v);