MATLAB: Problems with numerical integration with 2 variables

MATLABnumerical integration

Imagine I have an integral like this:
I can't use integral2!
In this expression, the internal integrals in are not analytical, so they must be done numerically. I can solve the whole equation? I have troubles doing the numerical integrals inside the big integral, because it can't give me an approximated equation in θ. If it was only one integral in theta prime, it would be solvable by "integral2", but it's not the case because there's a product of two ones.
Sergio Scalabrino

Best Answer

function main
Result = integral(@fun,0,pi/2)
end
function funret = fun(theta)
n = numel(theta);
funret = zeros(n,1);
for idx=1:n
funret(idx) = integral(@(thetastrich)f(theta(idx),thetastrich),0,pi)*...
integral(@(thetastrich)g(theta(idx),thetastrich),0,pi);
end
end
function fret = f(theta,thetastrich)
fret = ...;
end
function gret = g(theta,thetastrich)
gret = ...;
end