Search code examples
matlabintegral

matlab quadrature


I'm trying to use MATLAB dblquad for such an equation:

f(x,y)=\int_{0}^{1}(exp(-int_{0}^{y}f(x)dx))dy

f(x,y)=\int_{0}^{1}(exp(-int_{0}^{y}f(x)dx))dy

But it does not work. Is there any suitable MATLAB function for these type of double integrations?

Thanks a lot, mg


Solution

  • You have a nested integral rather than a double integral so dblquad will not work. How about

    q = quad(@(y)arrayfun(@(w)exp(-quad(f,0,w)),y),0,1)