%% Remove -Inf and NaN Values in Antenna PolarPattern
% Use Clean Data in Antenna Metrics to remove -inf and NaN values in a monopole antenna polar pattern. It is recommended to use Clean Data for partial data with -inf and NaN values.

m = monopole; 
m.GroundPlaneLength = inf;

%
% Plot the beamwidth of the antenna at 70 MHz.

figure;
beamwidth(m,70e6,0,-50:30)

%
% Plot the radiation pattern of the antenna at 70 MHz.

figure;
pattern(m,70e6,0,-50:30);

%
% Use polarpattern to view antenna metrics of the radiation pattern.

P = polarpattern('gco');
P.CleanData = 1;
P.AntennaMetrics = 1;

% Compare the beamwidth plot and the polarpattern plot. You will see that Antenna Metrics does not represent the beamwidth correctly.
% You can also Clean Data by right clicking on the plot and selecting Clean Data.
%
% After using Clean Data, you see that the polarpattern beamwidth calculation matches the beamwidth plot calculation.
%
% Copyright 2012 The MathWorks, Inc.