登录论坛

查看完整版本 : [MATLAB基础] 关于双重积分的问题


cqmobile_lee
2010-01-07, 15:57
请高手指导一下,搞了半天就是搞不懂呀!谢谢!
实现f(x,y)=2y;在x属于[-1,-0.8],y属于[0.8,1]的区间积分。
程序如下: syms x y
>> f = @(x,y)2*y;
>> I=dblquad(f,-1,-0.8,0.8,1);

报错如下:
??? Attempted to access y(7); index out of bounds because numel(y)=1.

Error in ==> quad at 70
if ~isfinite(y(7))

Error in ==> dblquad>innerintegral at 88
Q(i) = feval(quadf, intfcn, xmin, xmax, tol, trace, y(i), varargin{:});

Error in ==> quad at 62
y = f(x, varargin{:});

Error in ==> dblquad at 64
Q = feval(quadf, @innerintegral, ymin, ymax, tol, trace, intfcn, ...

就是不清楚错在哪里呀,请高手指点下,谢谢!