MATLAB: Double integration integral How to perform double integration of exp(-ax-by)*(x^m)*(y^n)/(cx+dy)where x & y lies between 0 and infinity, a,b,m,n,c,d are positive real numbers. Thank you. Best Answer If you have the 2012a release, just use INTEGRAL2:>> a = 2; b = 3; m = 2; n = 3; c = 2; d = 3;>> f = @(x,y)exp(-a*x-b*y).*(x.^m).*(y.^n)./(c*x+d*y)f = @(x,y)exp(-a*x-b*y).*(x.^m).*(y.^n)./(c*x+d*y)>> integral2(f,0,inf,0,inf)ans = 0.0030864Be sure to use .*, .^, and ./ to do elementwise operations instead of matrix ops.If you don't have 2012a yet, you can use the solution I presented here: http://www.mathworks.com/matlabcentral/answers/14514-double-integral-infinite-limits Related SolutionsMATLAB: Integral multiple infinite limits Try this:function q = paris(fun1,fun2,x,Kt)% q = ∫[exp(-u^2)*(∫fun1(v,u,x,Kt)dv)*(∫fun2(v,u,x,Kt)dv]du% The limits are 1e-9 <= v < inf and -inf < u < inf.a = 1e-9;innerintegral = @(u) ... arrayfun(@(u1) ... % u1 is always a scalar here. exp(-u1^2) * ... quadgk(@(v)fun1(v,u1*ones(size(v)),x,Kt),a,inf) * ... quadgk(@(v)fun2(v,u1*ones(size(v)),x,Kt),a,inf), ... u);q = quadgk(innerintegral,-inf,inf); MATLAB: How to plot a complicated function It is the same code you wrote, only add loops over c and tau, and use the function (ezplot) to plot a function handle. And DO NOT use (plot) command to plot functions. So try thisclcclear close allr=3.3;K=898;alpha=0.045;d=1.06;h=0.0437;theta=0.215;for c=0:0.1:0.9 for tau=0:0.1:0.6 x=d /(alpha*(-theta + d*h) / (-1 + c)); y=r*(K-x)*(-1-alpha*h*x+alpha*h*x*c)/(-1 + c)*K*alpha; yourfun=@(tau,c) -(r * x / K) + (alpha ^ 2 * (1 - c) ^ 2 * x * y / ... (1 + alpha * h * (1 - c) * x) ^ 2 * h) + d - d * exp(-2 * tau); ezplot(yourfun) title( {'\tau is ';num2str(tau);'c is ';num2str(c)} ) pause(0.01) end end Related QuestionDouble integral infinite limitsNot getting six coupled ODEs solution using bvp4c in MATLAB, Please help meA and B must be floating-point scalars.How to resolve this integral, i have the function in s and i want to integrate this function between t and infinity and get an explicit solution, can someone help me
Best Answer