Calculating double integral for exponential function

조회 수: 6 (최근 30일)
Malena Vasquez
Malena Vasquez 2020년 6월 7일
댓글: Malena Vasquez 2020년 6월 7일
Hi everyone! I'm trying to calculate this integral using Matlab but, being a beginner, I'm struggling a bit.
This is the code I attempted using the documentation, but by some reason the answer isn't correct. Any help improving it will be appreciated.
fun = (@(x,y) exp(x.^2));
xmin = @(y) y;
q = integral2(fun, 0, 1, xmin, 1);
  댓글 수: 2
madhan ravi
madhan ravi 2020년 6월 7일
Could you explain why the result is wrong?
Malena Vasquez
Malena Vasquez 2020년 6월 7일
If calculated manually, the result of the integral gives 0.85914
However, when run through MATLAB, its 0.6035

댓글을 달려면 로그인하십시오.

채택된 답변

madhan ravi
madhan ravi 2020년 6월 7일
syms x y
fun = exp(x.^2)
Wanted = vpa(int(int(fun,x,y,1),y,0,1))
% however I’m not sure why it returns that result

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by