Trapezoidal numerical integration using for loops
11 ビュー (過去 30 日間)
古いコメントを表示
Hi there,
I'm trying to create a for loop that calcuates the trapezoidal rule for a arrray of x and fx values without using the trapz function at different x points.
e.g.
x = 0, 0.25, 0.5, 0.75, 1
y = 0, 0.03, 0.006, 0.001, 0.06
Can someone please provide some guidance
0 件のコメント
回答 (1 件)
James Tursa
2022 年 9 月 30 日
編集済み: James Tursa
2022 年 9 月 30 日
See the Trapezoidal Method section here for the fomula:
or here:
Just write a for-loop to calculate the sum shown.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!