trap(a,b,n,f)
Version 1.1.0.0 (533 Bytes) by
Omer Refik Tan
Computes integral via Composite Trapezodial Rule between [a,b] with equally spaced points
Computes integral via Composite Trapezodial Rule between [a,b] with equally spaced points.
Example:
syms x
fun = x^2+x+1;
a = 0;
b = 1.6180 ;
n = 100;
result = trap(a, b, n, fun)
result =
4.3390
Cite As
Omer Refik Tan (2024). trap(a,b,n,f) (https://www.mathworks.com/matlabcentral/fileexchange/57272-trap-a-b-n-f), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2015b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Numerical Integration and Differential Equations in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.