Graphics Programs Reference
In-Depth Information
Element(i) = abs(sin(thetar(i)+0*dtr)); % use the abs function to avoid
end
case 'Phi'
thetar = thetad*dtr; % Pattern in a constant Theta plane
i = 0;
for phi = 0.001:1:361
i = i+1;
phir(i) = phi*dtr;
angled(i) = phi; angler(i) = phir(i);
Arrayfactor(i) = 0;
for n = 1:N
Arrayfactor(i) = Arrayfactor(i) + I(n)*exp(j*alpha(n)) ...
* exp( jka*(sin(thetar )*cos(phir(i)-phin(n))) ...
-jka*(sin(theta0r)*cos(phi0r -phin(n))) );
end
Arrayfactor(i) = abs(Arrayfactor(i));
Element(i) = abs(sin(thetar+0*dtr)); % use the abs function to avoid
end
end
angler = angled*dtr;
Element = Element/max(Element);
Array = Arrayfactor/max(Arrayfactor);
ArraydB = 20*log10(Array);
EtotalR =(Element.*Arrayfactor)/max(Element.*Arrayfactor);
figure(1)
plot(angled,Array)
ylabel('Array pattern')
grid
switch Variations
case 'Theta'
axis ([0 180 0 1 ])
% theta = theta +pi/2;
xlabel('Theta [Degrees]')
title ( 'phi = 90^o plane')
case 'Phi'
axis ([0 360 0 1 ])
xlabel('Phi [Degrees]')
title ( 'Theta = 90^o plane')
end
figure(2)
plot(angled,ArraydB)
%axis ([-1 1 -60 0])
ylabel('Power pattern [dB]')
grid;
Search WWH ::




Custom Search