How to implement Array factor in MATLAB?
55 ビュー (過去 30 日間)
表示 古いコメント

clc
clear all
close all
%arf of cca 4,16 ele
c=3*(10^8);
f=30*(10^9);
lambda=c/f;
l=[1 3] %mode
r=[0.5 1.5]*lambda %radii of each ring
k=(2*pi)/(lambda);
phio=0;
phi=0;
theta=0;
n=[4 16]; %no of ele
phi=[90:90:360 zeros(1,12); 22.5:22.5:360]
AF(1,1) = 0;
for m=1:2
for i=1:n(m)
AF(m,i)=exp((1j)*(((k)*(r(m))*(sin(deg2rad(theta)))*(cos(deg2rad(phi-phi(m,i))))+((l(m))*((-k)*r(m)*cos(deg2rad(phio-phi(m,i))))))));
end
end
Please help.
0 件のコメント
回答 (3 件)
Walter Roberson
2021 年 12 月 5 日
phi=[90:90:360 zeros(1,12); 22.5:22.5:360] is a 2 x 16 array.
AF(m,i)=exp((1j)*(((k)*(r(m))*(sin(deg2rad(theta)))*(cos(deg2rad(phi-phi(m,i))))+((l(m))*((-k)*r(m)*cos(deg2rad(phio-phi(m,i))))))));
The subtraction phi-phi(m,i) is taking all of phi and subtracting a scalar from it. That is going ot give you a 2 x 16 result because phi is 2 x 16. So the right hand side of the expression is going to be 2 x 16
Your formula defines AF(phi,I) where phi and I appear to be both M x N matrices. With your phi being 2 x 16 you should expect that the dimensions of AF should be 2 x 16 x (size of I) -- and that is after the double summation. Your code is not even doing the double summation.
ATHULRAJ
2023 年 2 月 27 日 8:48
AF= zeros(2,16);
for m=1:2
for i=1:n(m)
AF=AF+exp((1j)*(((k)*(r(m))*(sin(deg2rad(theta)))*(cos(deg2rad(phi-phi(m,i))))+ ((l(m))*((-k)*r(m)*cos(deg2rad(phio-phi(m,i))))))));
end
end
AFK=AF
0 件のコメント
参考
カテゴリ
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!