In: Advanced Math
In matlab ask the user to select whether to repeat the Newton-Raphson calculation or end the program. If the user exits out of the menu, repeat the request until the user makes a selection. If the program is repeated, store the new final value of the root and new number of iterations in the same variables without overwriting the previous results. Once the user chooses to end the program, save the variables containing the root values and numbers of iterations as calculation res.mat
this is my code so far
vector = input("Enter a vector which has an even number of elements: ");
the vector you enter is the polynomial you work with
the vector that is entered is [0.2 0.3 0 2.4 9.8 -21.4]
hat is the initial guess?
2
Would you like to continue y/n ? y
What is the initial guess? 4
Would you like to continue y/n ? y
What is the initial guess? 5
Would you like to continue y/n ? y
What is the initial guess? 7
Would you like to continue y/n ? y
What is the initial guess? 9
Would you like to continue y/n ? y
What is the initial guess? 11
Would you like to continue y/n ? y
What is the initial guess? 13
Would you like to continue y/n ? y
What is the initial guess? n
Would you like to continue y/n ?
root iteration
8.0000000000001
500
7.99999999999999
500
8
5
8
4
8
4
8
5
8
5
8
500