>> help filename

in Matlab command window. (here 'filename' should be replaced by actual name, for instance, midp).

Here is a user-defined function, which can be modified and used as an input to the numerical integration or differentiation subroutines below: myfunc.m

Finite difference formulas for numerical differentiation:

- Two-point forward difference formula for first derivative: d1fd2p.m
- Three-point centered-difference formula for first derivative: d1cd3p.m
- Three-point centered-difference formula for second derivative: d2cd3p.m
- Two-point forward difference formula for first derivative, varying h: d1fd2p_varh
- Three-point centered-difference formula for first derivative, varying h: d1cd3p_varh.m
- Three-point centered-difference formula for second derivative, varying h: d2cd3p_varh.m

- Trapezoid rule: trap.m
- Simpson's rule: simp.m
- Newton's rule: newt.m
- Boole's rule: boole.m
- Midpoint rule: midp.m
- Two-point open rule: mid2p.m
- Three-point open rule: mid3p.m

- Romberg integration: romberg.m
- Adaptive trapezoid method (uses trap.m above): adaptrap.m