Calculating double integral for exponential function

16 visualizzazioni (ultimi 30 giorni)
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 Commenti
madhan ravi
madhan ravi il 7 Giu 2020
Could you explain why the result is wrong?
Malena Vasquez
Malena Vasquez il 7 Giu 2020
If calculated manually, the result of the integral gives 0.85914
However, when run through MATLAB, its 0.6035

Accedi per commentare.

Risposta accettata

madhan ravi
madhan ravi il 7 Giu 2020
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

Più risposte (0)

Categorie

Scopri di più su Programming in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by