%% Add Angle and Magnitude Data to Polar Pattern
% Create a dipole and plot the polar pattern of its directivity at a frequency of 75 MHz.

d = dipole;
D = pattern(d,75e6,0,0:1:360);
P = polarpattern(D);

%
% Create a cavity antenna. Calculate the directivity of the antenna at 1 GHz. Write the directivity of the antenna to cavity.pln using the msiwrite function.

c = cavity;
msiwrite(c,1e9,'cavity','Name','Cavity Antenna Specifications');

%
% Read the data from cavity.pln to Horizontal, Vertical, and Optional structures using the msiread function.

[Horizontal,Vertical,Optional] = msiread('cavity.pln')

%
% Add horizontal directivity data of the cavity antenna to the existing polar pattern of the dipole

add(P,Horizontal.Azimuth,Horizontal.Magnitude);

% Copyright 2012 The MathWorks, Inc.