Anonymous user
Composite Trapezoid Rule: Difference between revisions
no edit summary
(Created page with "In mathematics, and more specifically in numerical analysis, the trapezoidal rule (also known as the trapezoid rule or trapezium rule) is a technique for approximating the In...") |
No edit summary |
||
Line 1:
In numerical analysis, the trapezoidal rule is used for approximation of a definite integral. The code here is a general purpose code for any equation.
== MATLAB ==
function integral = trapezoidal(f, a, b, n)
Line 12:
integral = h*result;
end
f is the equation, a is the lower limit, b is the upper limit, and n is the number of trapezoids or number of integration points.
|