lamda=650*10e-9; %设定波长
I0=10; %光源中心光强
l1=0.5;
l2=0.3;
r=0.25; %光斑半径
D=0.1; %观察屏距离
l=0.07; %观察屏大小
x=linspace(-l,l,500);
y=linspace(-l,l,500);
syms a b;
for i=1:500
for j=1:500
L1(i,j)=l1+12+sqrt(D^2+(x(i)-a)^2+(y(j)-b)^2); %光束1的光程
L2(i,j)=l1+(l2/cos(2*2.865*10e-3))+sqrt((D/cos(2*2.865*10e-3))^2+(x(i)-a)^2+(y(j)-b)^2); %光束2的光程
phi(i,j)=2*pi*(L2(i,j)-L1(i,j))/lamda; %双光束的相位差
I1=I0*exp(-pi*5*(a^2+b^2));
I0(i,j)=I1+I1+2*sqrt(I1*I1)*cos(phi(i,j)); %复色光的光强
Q(i,j)=dblquad(I0(i,j),-0.25,0.25,-0.25,0.25); %积分得到观察屏上的光强
end
end
我想求这么个积分,可是提示错误:
The following error occurred converting from sym to double:
Error using mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.
应该怎么解决