{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

MATLAB_lab2

# MATLAB_lab2 - MATLAB Solving a Nonlinear Equation In the...

This preview shows pages 1–2. Sign up to view the full content.

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 Newton’s 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. It’s 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.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

MATLAB_lab2 - MATLAB Solving a Nonlinear Equation In the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online