Question: Write a matlab script that finds the root of f ( x ) = e ^ ( - x ) - x using the Secant
Write a matlab script that finds the root of fxexx using the Secant Method, with initial guesses of x and x
As a reminder, the formula for the Secant method is xixifxixixifxifxi
Implement this formula within a looping structure, iteratively improving your estimate of the solution for the root value until the absolute approximation relative error between the current estimate for a solution and the previous estimate is less than
Upon completion, your script should display the final solution value for the root, the final value of the absolute approximate relative error, and how many iterations it took to arrive at this value. These should be the only things that display in the command window.
Also, output a plot with two lines on the same axes, one for the absolute approximate relative error and the other for the absolute true relative error, with the error percentage on the vertical axis against iteration number on the horizontal axis. To do this, you will need to store the value for each calculated error, as well as each iteration count, in an arrays every pass through the loop. Include a legend and axis labels. The vertical axis label should specify the indicated errors are in percentage form.
Consider the true solution value for the root to be
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
