This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: MATLAB - Solving a Nonlinear Equation In the last lab we learned some basic MATLAB commands and learned how to write two types of M-files - scripts and functions. In addition, we solved a nonlinear equation using the Bisection method. In this lab we will learn some new commands and solve some nonlinear equations using the Regula Falsi, secant and Newtons methods. New commands : feval while pause 1. You can download a Regula Falsi function from our web page or write your own. The code on our web page is complete except that it performs a fixed number of iterations and has no other stopping criteria. Its usually a good practice to have a fixed number of iterations in case your stopping criteria is never met. Add to the code the stopping criteria of checking the function value (we discussed this in class on Tuesday) Test your code by finding the root of f ( x ) = x cos x with starting values of 0 and 1. Use 10 5 as your tolerance for the stopping criteria....
View Full Document
This note was uploaded on 12/14/2011 for the course FIN 5515 taught by Professor Staff during the Spring '10 term at FSU.
- Spring '10