I made a "toy" problem.
f=@(x,y)x.*sin(y.*x)./y;
g=@(y)integral(@(x)f(x,y),0,1);
s=integral(g,0,2,'ArrayValued',true).
This works, no problem. f(x,y) has a removable singularity at y=0 which is successfully handled by Matlab.
In my real problem f(x,y) also has a removable singularity but f(x,y) contains a combination of Bessel functions so that
I decided to write a case-defined function which (for my "toy" problem) has the form
function fun_f=f
if y ==0
fun_f = @(y,x)x.^2;
else
fun_f = @(y,x)x.*sin(y.*x)./y;
end
end
The problem I have is how to compute s in case f(x,y) is given by the function decsribed above.
Best Answer