Write an algorithm and Matlab function JN, which uses the Composite Trapez-
ium Rule (CTR) to compute an approximation of the integral f(x) dx for an arbitrary
function f of one variable. The inputs should be a, b and N (the number of
subintervals), and f (the name of a Matlab function of one variable). The
output should be the approximate integral value JNf, i.e. the result of the
Composite Trapezium Rule for f.
The Attempt at a Solution
Most of it looks right but i'm sure i have done something wrong. is there something missing with defining f.