• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Simple MATLAB codes

Joined
4/11/09
Messages
11
Points
11
hello, i am preparing for a numerical analysis exam, and i need to learn some basic matlab codes.
So if any of you can help with the following:
1- Newton's method for solving a non-linear equation
2- Composite Simpson's rule for computing a simple definite integral
3- Second-order Taylor method for solving an ODE

I googled it, but i couldn't find a self-containing code...what i need to learn is a code that contains the functions, the inputs and the outputs, without the need of multiple .m files.

Thank you for the help :D
 
Please find attached functions for Newton method (newton.m) and composite Simpson method (compositeSimpson.m), as well as corresponding test files (newton_test.m and compositeSimpson_test.m). As mentioned in comments, these simple scripts are written according to Burden & Faires "Numerical Analysis" book. I understand you asked for everything related to a method to be into single file, but this is not good practice, and if you still want it, you should be able to easily incorporate functions code inline into the test scripts.
 

Attachments

  • num_met.zip
    1.2 KB · Views: 396
Back
Top