I have a problem with calculating Ep(I). Any suggestion how to sole this problem?
clear all;% element numbers N, wavenumber B
N = input ('Enter the Number of Array Elements : ') ; lambda = input ('Enter the Value of Lambda (c/f) : ') ;B =(2*pi/lambda);% Magnitude, Phase, X,Y,Z coordinate
for I = 1 : N Current = I An(I) = input ('Enter the Magnitude of the Current : ') ; Jp(I) = input ('Enter the Phase of the Current : ') ; Xn(I) = input ('Enter the Position of Element on X-axis : ') ; Yn(I) = input ('Enter the Position of Element on Y-axis : ') ; Zn(I) = input ('Enter the Position of Element on Z-axis : ') ;end%azimut--> 0<Phi<360, elevation--> 0<Theta<180
Phhi = (0:1:360)*2*pi/180;Thheta = (0:1:180)*2*pi/180;[PHI,THETA] = meshgrid(Phhi,Thheta);%R=[];
% calculate the array factor
for I = 1:N Ep(I)= B.*((Xn(I).*cos(PHI).*sin(THETA))+(Yn(I).*sin(THETA).*sin(PHI))+(Zn(I).*cos(THETA))); R(I)= An(I).*exp(1i.*(Ep(I)+(Jp(I).*pi/180)));endh(THETA,PHI) = sum(R);AF(THETA,PHI) = abs(h(THETA,PHI));%plot the array factor
X = AF.*sin(THETA).*cos(PHI);Y = AF.*sin(THETA).*sin(PHI);Z = AF.*cos(THETA);figure(2);mesh(X,Y,Z); %display
%surf(X,Y,Z) %colored faces
Best regards, Tadej
Best Answer