Anonymous user
Composite Trapezoid Rule: Difference between revisions
m
→MATLAB
No edit summary |
m (→MATLAB) |
||
Line 5:
function integral = trapezoidal(f, a, b, n)
result = 0.5*f(a) + 0.5*f(b);
for i = 1:(n-1)
result = result + f(a + i*
end
integral =
end
|