%% Visualize 2-D Radiation Patterns of Helix Directivity
% Calculate the magnitude, azimuth, and elevation angles of a helix's directivity at 2 GHz.

h = helix;
[D,az,el] = pattern(h,2e9);

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

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

%
% Plot 2-D phi slice of the antenna in rectangular coordinates.

figure;
patternCustom(MagE,theta,phi,'CoordinateSystem','rectangular',...
    'Slice','phi','SliceValue',0);

%
% Plot 2-D phi slice of the antenna in polar coordinates.

figure;
patternCustom(MagE, theta, phi,'CoordinateSystem','polar',...
    'Slice','phi','SliceValue',0);

% Copyright 2012 The MathWorks, Inc.