Files
School/Anul 3/Semestrul 2/Calcul numeric/trapz_int.m
T
2025-07-03 20:56:38 +03:00

5 lines
109 B
Objective-C

function R = trapz_int(f, a, b, n)
R = ((b-a)/(2*n)) * (f(a)+f(b)+2*sum(f(a+([1:n-1])*((b-a)/n))));
end;