我正在尝试解决双重积分,其中我正在使用 quadgk 函数解决内部积分和外部积分。
% The integrand is of course a function of both x and y
integrand = @(x,y) (phi(j,y,X) - phi(j,x,X))*(phi(i,y,X) - phi(i,x,X))/abs(y-x)^(2*s+1)
% The inner integral is a function of x, and integrates over y
inner = @(x) quadgk(@(y)integrand(x,y), x-lambda, x+lambda)
% The inner integral is integrated over x to yield the value of the double integral
dblIntegral = quadgk(inner, -(1+lambda), 1+lambda)
我收到以下错误:
integrand = @(x,y)(phi(j,y,X)-phi(j,x,X))*(phi(i,y,X)-phi(i,x,X))/abs(y-x)^(2*s+1)
inner = @(x)quadgk(@(y)integrand(x,y),x-lambda,x+lambda)
??? Error using ==> quadgk at 108
A and B must be scalar floats.
Error in ==> @(x)quadgk(@(y)integrand(x,y),x-lambda,x+lambda)
Error in ==> quadgk>evalFun at 344
fx = FUN(x);
Error in ==> quadgk>f1 at 362
[y,too_close] = evalFun(tt);
Error in ==> quadgk>vadapt at 258
[fx,too_close] = f(x);
Error in ==> quadgk at 197
[q,errbnd] = vadapt(@f1,interval);
Error in ==> frational_laplacian at 29
dblIntegral = quadgk(inner, -(1+lambda), 1+lambda)