Integration of a function using the trapezoid rule?

2 visualizaciones (últimos 30 días)
Kyle Miller
Kyle Miller el 2 de Mayo de 2016
Respondida: Matt J el 2 de Mayo de 2016
I need to integrate the function f(x)=sin(x) between the bounds of 0 and pi/2 using the trapezoid rule repeating the calculation with 3 different numbers of panels N=20,30,50. Also I have to show the errors between the results and the exact value of the integral. I'm not familiar with the trapezoid rule and I'm really struggling with this question. Thank you

Respuestas (1)

Matt J
Matt J el 2 de Mayo de 2016
The TRAPZ command will be helpful here.

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by