matlab+mex+command,积分函数提示错误 Error using mupadmex Error in MuPAD command

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.

应该怎么解决

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值