%% Visualize 3-D Electric Field Pattern of Dipole
% Calculate the magnitude, azimuth, and elevation angles of a dipole's electric field at 75 MHz.

d = dipole;
[efield,az,el] = pattern(d, 75e6,'Type','efield');

%             Here, az =  the angle from the positive x-axis to the efield vector's orthogonal projection onto the xy plane, moving in the direction towards the y-axis.
%                       el = the angle from the efield vector's orthogonal projection onto the xy plane to the vector, moving in the direction towards the z-axis.
%
% Extract the theta and phi angles of the electric field magnitude of the antenna.

phi = az';
theta = (90-el);
MagE = efield';

%
% Plot the 3-D electric field pattern.

patternCustom(MagE,theta,phi);

% Copyright 2012 The MathWorks, Inc.