na-lab-trapezoidal

Version 1.0.0 (1.12 KB) by Akshay
code
1 Download
Updated 14 Nov 2022

View License

clc;
close all;
f=input("Enter the function");
a=input("enter the starting interval");
b=input("enter the ending interval");
n=input("enter the subinterval");
h=(b-a)/n;
sum=0;
for i=1:n-1
x=a+h*i;
sum=sum+2*f(x);
end
sum=sum+f(a)+f(b);
sum=(h/2)*sum;
disp(sum);

Cite As

Akshay (2024). na-lab-trapezoidal (https://www.mathworks.com/matlabcentral/fileexchange/120418-na-lab-trapezoidal), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0