I want to do the same process with this code also
I asked a question at URL: https://www.mathworks.com/matlabcentral/answers/2113451-i-tried-this-code-but-it-gives-me-an-error.
@voss
You solved my problem. Now I want to solve it just like that but that was one dimensional problem i.e., only one angle "Theta" was associated with one far field source i.e., the angle of elevation only i.e., the two sources were having 2 angles. But its a two dimensional case. i.e., here each source has two angles i.e., angle of elevation and angle of azimuth i.e., the two sources have 4 angles now. If I take them in vecor u, it will be like this: u=[30 50 65 80]; where 1st two angles (i.e., 30 and 50) are for 1st far field source and the last two angles (i.e., 65 and 80) are for the 2nd far filed source. so the formula now has both Theta and Phi. So now I want to put them in those formulas given below and the number of antennas ara again 8. The 3D Array Factor formula is given in the attachment. I tried but in vain.
clear;clc
f=1e9;% frequency
c=3e8;% Speed of light
l=c/f;% lambda
k=(2*pi)/l;% wavenumber
N=8;% Number of antennas
n=0:N-1;
phi_n=2*pi*n/N;
phi=-pi:pi/18:pi;
theta=0:pi/18:pi/2;
u=[30 50 60 80];% four angles
M=length(u);%M=length(theta);
P=length(phi);
d_circular=l/2;% spacing b/w antennas
circumference = N*d_circular;
a=circumference/(2*pi);% radius
AF(m,p)=sum(exp(-i*k*a*sin(theta(m))*(cos(phi(p)-phi_n))));
x(m,p)=abs(AF(m,p))*sin(theta(m))*cos(phi(p));
y(m,p)=abs(AF(m,p))*sin(theta(m))*sin(phi(p));
z(m,p)=abs(AF(m,p))*cos(theta(m));I asked a question at URL: https://www.mathworks.com/matlabcentral/answers/2113451-i-tried-this-code-but-it-gives-me-an-error.
@voss
You solved my problem. Now I want to solve it just like that but that was one dimensional problem i.e., only one angle "Theta" was associated with one far field source i.e., the angle of elevation only i.e., the two sources were having 2 angles. But its a two dimensional case. i.e., here each source has two angles i.e., angle of elevation and angle of azimuth i.e., the two sources have 4 angles now. If I take them in vecor u, it will be like this: u=[30 50 65 80]; where 1st two angles (i.e., 30 and 50) are for 1st far field source and the last two angles (i.e., 65 and 80) are for the 2nd far filed source. so the formula now has both Theta and Phi. So now I want to put them in those formulas given below and the number of antennas ara again 8. The 3D Array Factor formula is given in the attachment. I tried but in vain.
clear;clc
f=1e9;% frequency
c=3e8;% Speed of light
l=c/f;% lambda
k=(2*pi)/l;% wavenumber
N=8;% Number of antennas
n=0:N-1;
phi_n=2*pi*n/N;
phi=-pi:pi/18:pi;
theta=0:pi/18:pi/2;
u=[30 50 60 80];% four angles
M=length(u);%M=length(theta);
P=length(phi);
d_circular=l/2;% spacing b/w antennas
circumference = N*d_circular;
a=circumference/(2*pi);% radius
AF(m,p)=sum(exp(-i*k*a*sin(theta(m))*(cos(phi(p)-phi_n))));
x(m,p)=abs(AF(m,p))*sin(theta(m))*cos(phi(p));
y(m,p)=abs(AF(m,p))*sin(theta(m))*sin(phi(p));
z(m,p)=abs(AF(m,p))*cos(theta(m)); I asked a question at URL: https://www.mathworks.com/matlabcentral/answers/2113451-i-tried-this-code-but-it-gives-me-an-error.
@voss
You solved my problem. Now I want to solve it just like that but that was one dimensional problem i.e., only one angle "Theta" was associated with one far field source i.e., the angle of elevation only i.e., the two sources were having 2 angles. But its a two dimensional case. i.e., here each source has two angles i.e., angle of elevation and angle of azimuth i.e., the two sources have 4 angles now. If I take them in vecor u, it will be like this: u=[30 50 65 80]; where 1st two angles (i.e., 30 and 50) are for 1st far field source and the last two angles (i.e., 65 and 80) are for the 2nd far filed source. so the formula now has both Theta and Phi. So now I want to put them in those formulas given below and the number of antennas ara again 8. The 3D Array Factor formula is given in the attachment. I tried but in vain.
clear;clc
f=1e9;% frequency
c=3e8;% Speed of light
l=c/f;% lambda
k=(2*pi)/l;% wavenumber
N=8;% Number of antennas
n=0:N-1;
phi_n=2*pi*n/N;
phi=-pi:pi/18:pi;
theta=0:pi/18:pi/2;
u=[30 50 60 80];% four angles
M=length(u);%M=length(theta);
P=length(phi);
d_circular=l/2;% spacing b/w antennas
circumference = N*d_circular;
a=circumference/(2*pi);% radius
AF(m,p)=sum(exp(-i*k*a*sin(theta(m))*(cos(phi(p)-phi_n))));
x(m,p)=abs(AF(m,p))*sin(theta(m))*cos(phi(p));
y(m,p)=abs(AF(m,p))*sin(theta(m))*sin(phi(p));
z(m,p)=abs(AF(m,p))*cos(theta(m)); want to do like previous one, how, homework MATLAB Answers — New Questions