Double integral by composite Simpson rule
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Helo :)
I need to write Composite Simpson rule for double integration od values x and y. I have a function
, where lower limit for x is
and upper is
and lower limit for y is
and upper limit for y is
, and
and
. So far I have this code, but it is for one value and i dont know how to fix it. I wanna first write a code for this rule and than make calculation for my function. Can please someone hlep mi fix this code:
function vr = simpson2d(f,a,b,c,d,n,m)
x = a:n:b;
y = c:m:d;
h=(b-a)/n;
vr= h/3*(f(xi(1))+2*sum(f(xi(3:2:end-2)))+4*sum(f(xi(2:2:end)))+f(xi(end)));
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!