主题: [MATLAB基础] 关于双重积分的问题
查看单个帖子
旧 2010-01-07, 15:57   #1
cqmobile_lee
初级会员
 
注册日期: 2010-01-07
帖子: 1
声望力: 0
cqmobile_lee 正向着好的方向发展
默认 关于双重积分的问题

请高手指导一下,搞了半天就是搞不懂呀!谢谢!
实现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, ...

就是不清楚错在哪里呀,请高手指点下,谢谢!
cqmobile_lee 当前离线   回复时引用此帖