Double integral with limits

조회 수: 4 (최근 30일)
Ramkumar P
Ramkumar P 2020년 10월 1일
댓글: Ramkumar P 2020년 10월 1일
Hey there everyone, I am having trouble solving a double integral using MATLAB.
The manual calculation is shown in the above figure. However, when i try to program it in MATLAB it is not displaying the correct ans as the given figure.
Th following code is displayed below.
f = @(x,y) exp(2*x).*(cos(y));
g1= @(x) sin(x);
q = integral2(f,0,pi,0,g1);
How do I troubleshoot this?

답변 (1개)

madhan ravi
madhan ravi 2020년 10월 1일
f = @(y, x) exp(2*x).*(cos(y)); % order of integration was wrong
g1= @(y) sin(y);
q = integral2(f,0,pi,0,g1)
% Using Symbolic Math Toolbox to verify
syms x y
q = int(int(exp(2*x).*(cos(y)), x, 0, sin(y)), y, 0, pi)
  댓글 수: 1
Ramkumar P
Ramkumar P 2020년 10월 1일
Thank you So much:)

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by