matlab程序出错求问大神修改!高分! 100
是有关贝塞尔函数的,程序如下:>length=6328e-8;R=3e-3;gama=175e-4;n=1.5;>>z=0.2;k=1.38e+12;>>range=4....
是有关贝塞尔函数的,程序如下:
> length=6328e-8 ;R=3e-3; gama=175e-4; n=1.5;
>> z=0.2;k=1.38e+12;
>> range=4.0; np=800;
yp=linspace(-range,range,np); xp=yp/2;
ns=500; ys=linspace(-R,R,ns);
>> for i=1:1:np
syms ys yp ;J=besselj(0,k.*ys.*yp(i)./z).*ys;
M=exp(i*k.*ys./(2*z)-i*k*(n-1)*gama*ys);
L=int(J.*M.*ys,0,R);
E=-i*k./z.*exp(i*k*z).*exp(i*k.*yp(i).^2./(2*z)).*L;
I=E.^2;
end
Warning: Explicit integral could not be found.
??? Error using ==> mupadmex
Error in MuPAD command: Index exceeds matrix dimensions.
Error in ==> sym.sym>sym.subsref at 1381
B = mupadmex('symobj::subsref',A.s,inds{:});
想问里面 ys.*yp(i),为什么不可以当成元素相乘,而是矩阵相乘,
重点是看不懂后面的错误,应该怎么改! 展开
> length=6328e-8 ;R=3e-3; gama=175e-4; n=1.5;
>> z=0.2;k=1.38e+12;
>> range=4.0; np=800;
yp=linspace(-range,range,np); xp=yp/2;
ns=500; ys=linspace(-R,R,ns);
>> for i=1:1:np
syms ys yp ;J=besselj(0,k.*ys.*yp(i)./z).*ys;
M=exp(i*k.*ys./(2*z)-i*k*(n-1)*gama*ys);
L=int(J.*M.*ys,0,R);
E=-i*k./z.*exp(i*k*z).*exp(i*k.*yp(i).^2./(2*z)).*L;
I=E.^2;
end
Warning: Explicit integral could not be found.
??? Error using ==> mupadmex
Error in MuPAD command: Index exceeds matrix dimensions.
Error in ==> sym.sym>sym.subsref at 1381
B = mupadmex('symobj::subsref',A.s,inds{:});
想问里面 ys.*yp(i),为什么不可以当成元素相乘,而是矩阵相乘,
重点是看不懂后面的错误,应该怎么改! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询