Java Scrap Book  

Java Scrap Book > MATLAB > Directivity

Directivity

function directivity
clear all;
%Plotting the directivity function
for i=1:100
theta(i)=pi*(i-1)/99;
d(i)=7.5*((cos(theta(i)))^2)*((sin(theta(i)))^2);
end
subplot(2,1,1);
polar(theta,d);
title('Directivity of Antenna');

%Directivity of half wave dipole antenna
sum=0.0;
D=[];
for j=1:3
N=[10 15 20];
for i=1:N(j)
thetai=(pi/N(j))*(i-0.5);
sum=sum+(cos((pi/2)*cos(thetai)))^2/sin(thetai);
end
D=[D (2*N(j))/(pi*sum)];
end
subplot(2,1,2);
plot(N,D);
xlabel('Directivity');
ylabel('N');
title('Directivity of half dipole antenna');
end


Copyright © 2013-2018

javascrapbook.com is a computer science content service should not be treated as the publisher or speaker of any information provided by another Computer Science content provider.

Contact email: help@javascrapbook.com