错误:C:/ Users / ece / rectangular apreture.m:运算符*:参数不一致(op1为1x51,op2为1x101)
clc;
clear all
close all
a = 0.1;
b = 0.05;
freq = 3e9;
E0 = 3;
c= 3e8;
lambda = c/freq;
k = 2*pi/lambda;
alpha_deg=input('Enter the phase variation along x (in degrees per unit length(of the order of 1000))= ')
beta_deg=0
alpha = alpha_deg*pi/180;
beta = beta_deg*pi/180;
r=[];
while isempty(r),
r=input('Enter the distance of the observation point from the aperture (in SI units) = ');
end;
theta = -pi/2:0.02*pi:pi/2;
phi = 0:0.02*pi:2*pi;
E_theta = [];
E_phi = [];
for m = size(theta,2)
for n = size(phi,2)
x=((k*a)/2)*(sin(theta)*cos(phi));
y=((k*b)/2)*(sin(theta)*sin(phi));
E_theta(m,n) = (1j*k*a*b*E0/(2*pi*r)) * exp(-j*k*r) * (sin(phi))*(sin(x)/x)*(sin(y)/y);
E_phi(m,n) = -(1j*k*a*b*E0/(2*pi*r)) * exp(-j*k*r) * (cos(phi))*(cos(theta))*(sin(x)/x)*(sin(y)/y);
end
end
figure;
polar(transpose(theta),abs(E_theta(:,50)), '--r')
title('E_\theta')
figure;
polar(transpose(theta),abs(E_phi(:,50)), '--r')
title('E_\phi')