Double integral with limits

13 vues (au cours des 30 derniers jours)
Ramkumar P
Ramkumar P le 1 Oct 2020
Commenté : Ramkumar P le 1 Oct 2020
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?

Réponses (1)

madhan ravi
madhan ravi le 1 Oct 2020
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 commentaire
Ramkumar P
Ramkumar P le 1 Oct 2020
Thank you So much:)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by