Math 578 > Matlab files

Matlab files

Here you can find some m-files with commentaries. To see the commentary, type

>> help filename

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

Disclaimer: These files are provided "as is", without warranties of any kind.

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
Composite Newton-Cotes rules for numerical integration: More advanced algorithms for numerical integration: Equation solvers:
  • A simple implementation of Newton's method: newton.m
  • A simple implementation of the secant method: secant.m
 

MATH 578: Numerical Analysis 1 Fall 2009