Integration of a function using the trapezoid rule?

2 ビュー (過去 30 日間)
Kyle Miller
Kyle Miller 2016 年 5 月 2 日
回答済み: Matt J 2016 年 5 月 2 日
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

回答 (1 件)

Matt J
Matt J 2016 年 5 月 2 日
The TRAPZ command will be helpful here.

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by