我正在尝试在 MATLAB 中计算各向同性天线的阿基米德螺旋阵列的功率模式的 2D 极坐标图。这需要一个大小不同的 theta 和 phi 数组。
我正在使用的代码如下:
clear all
close all
clc
r=27000;
phi=0:.02:2*pi;
theta=0:.02:pi/2;
px=r.*cos(phi);
py=r.*sin(phi);
wL=1;
k=(2*pi)/wL;
d=px.*sin(theta).*cos(phi)+py.*sin(theta).*sin(phi);
phase=0;
psi=k.*d+phase;
N=27;
PowPatt=(sin(N.*(psi./2))./(N.*sin(psi./2))).^2;
polar(psi,PowPatt)
自然我得到以下错误:
??? Error using ==> times
Matrix dimensions must agree.
Error in ==> powerpattern at 11
d=px.*sin(theta).*cos(phi)+py.*sin(theta).*sin(phi);
无论如何要更改我的代码以对 theta 和 phi 数组执行算术运算?谢谢你。
帕特里克