Double integral by composite Simpson rule

2 visualizaciones (últimos 30 días)
Neza Krzan
Neza Krzan el 19 de Mayo de 2021
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)));

Respuestas (0)

Categorías

Más información sobre Numerical Integration and Differential Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by