Add code to a function that finds roots of an equation using the Newton-Raphson method
- Modify the code to display the new "guess" value on each iteration of the loop (i.e., display the value of X). Display the value with at least 15 digits of accuracy after the decimal point. (This will require the use of the fprintf() function.)
- Add a counting variable that counts the number of times the loop executes and display this value after the loop terminates.
%this function will find roots of an equation using the Newton-Raphson method
Tolerance = 10e-15;
X = input('Please enter your best guess where a root might be: ');
while abs(f(X)) > Tolerance
X = X - f(X)/f_derivative(X);
fprintf('Root: f(%0.15f) = %0.15f\n', X, f(X));
Count = 1
while Count <= 10
Count = Count + 1
I have this newton-raphson code, but I need some guidance because I know there's more to it.