|
楼主 |
发表于 2007-5-23 15:23
|
显示全部楼层
function I=dbl_itg(fun,c_lo,c_hi,a,b,m,n)
h=double(6.63*10^(-34));
m=double(1.75e5);
u1=1;
u2=3;
y0=0;
n0=1e4;
v=5e14;
d=0.13;
k=h*v*n0*u1*m/(4*pi);
syms x y
%fun=k/((d-x)^2+(y-y0)^2)*exp((-1)*(u1+u2*sqrt(((d-x)^2+(y-y0)^2))));
m=6;n=6;
b=0.13;
a=0;
c_lo=-50;
c_hi=50;
if m<2 |n<2
fprintf('number of interals invalid\n');
return
end
mpt=m+1;npt=n+1;
hx=(b-a)/m;
x=a+(0:m)*hx;
for i=1:mpt
ylo=c_lo;
yhi=c_hi;
hy=(yhi-ylo)/n;
y=ylo+(0:n)*hy;
f(i,:)=feval(@fun,x(i),y(i));
G(i)=Simps_v(f(i,:),hy)
end
I=Simps_v(G,hx);
修改过后又出现错误??? Error using ==> fun
Too many output arguments.
Error in ==> D:\MATLAB6p1\work\dbl_itg.m
On line 30 ==> f(i,:)=feval(@fun,x(i),y(i));
麻烦问下我要怎么修改?我真的不会阿! |
|