MATLAB: Dipole antenna far-field pattern

plotting

I need to plot the radiation pattern for a dipole antenna of length L=lambda/2. The example plot given was of L=1.4*lambda.
Example plot of L=1.4*lambda:
My code to try and reproduce the plot for L=1.4*lambda:
%Wavelength
lam = 1;
%Dipole antanna
L = 1.4*lam;
%Phase constant
B = 2*pi/lam;
t = 0:0.01:2*pi;
% Far-field pattern equation
E = abs((cos(B*L/2*cos(t))-cos(B*L/2))./sin(t));
figure()
polar(t,E)
Plot from this code:
I can't figure out where I'm going wrong with this one…

Best Answer

Hi Vinci, power is proportional to the square of the electric field, so if you use
E2 = abs((cos(B*L/2*cos(t))-cos(B*L/2))./sin(t)).^2;
figure()
polar(t,E2)
the correct figure should pop up.