尝试使用以下代码评估作为 q,u 函数的三重积分。得到错误,
Warning: Maximum function count exceeded; singularity likely.
In quad at 107
In test1>Inner at 12
In test1>@(x)Inner(x) at 5
In quad at 76
In test1 at 5
有谁知道这段代码有什么问题?
function [r] = test1(q,u)
b = u;
r = zeros(1);
for i = 1 : length(q);
r(i) = quad(@(x)Inner(x),-2,q);
end;
function [w] = Inner(k)
w = zeros(1);
for i = 1 : length(k);
w(i) = quad(@(n)InnerIntegral(n).*unifpdf(k(i)-n,-1,1),0,k(i)-1,k(i)+1);
end;
function [y] = InnerIntegral(n)
y = zeros(1);
for i = 1 : length(n);
y(i) = quad(@(m)unifpdf(n(i)-m, -b, b).*unifpdf(m,-b,b), n(i)-b,n(i)+b);
end;
end
end
end