Question
Newton Raphson Method using Matlab 1. Write a MATLAB progrm that implements the Newton method for root-finding problem. The input parameter should be: the function
Newton Raphson Method using Matlab
1. Write a MATLAB progrm that implements the Newton method for root-finding problem.
The input parameter should be: the function f, the derivative of the function df, the initial guess, an error tolerance, and the maximum number of iterations.
The program should stop when the approximate percent error is less than or equal the tolerance.
Your output should be a table where each row contains the number of iteration, the value of the root, and the percent approximate error.
2. In order to test your program to compute the root of e^-x=cos(x) +1 with tolerance 10^-6, create a main M-file where you can call you program, the necessary function(s), and that should the output of roots (to 5 significant figures)
3. Everything should work by simply running the main M-file. The output table should be printed on the screen, and your program shoud create a plot of the used function and a point representing the root
4. Your final submission should include:
a) Your M-file for question 1
b) The main M-file for question 2
c) When you run the main M-file, the output table should be printed on the screen, and a plot of the function with the root point should be created.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started