%% Visualize Radiation Pattern From Antenna Data File
% Consider a helix antenna data file in .csv format. This file contains the magnitude of the antenna directivity in phi and theta angles. Read the file .

helixdata = csvread('antennadata_test.csv',1,0);

%
% Use patternCustom to extract the magnitude of directivity, and the phi, and theta angle values. Plot the 3-D polar radiation pattern.

patternCustom(helixdata(:,3),helixdata(:,2),helixdata(:,1));

% Use the same data to plot the 3-D rectangular radiation pattern.

figure
patternCustom(helixdata(:,3),helixdata(:,2),helixdata(:,1),...
 'CoordinateSystem','rectangular');

% Copyright 2019 The MathWorks, Inc.
%
%