I have to finish this and don't know how to exactly do it: The algorithm is very simple. We want to find x= ∜N
Make an initial guess for x: Est. See how close you are: Error = abs(Est4 – N) If the Error is too big, update the estimate as follows:
Est=Est- (Est^4-N)/(4*Est^3 )
Recalculate the Error using the new estimate Repeat until the value of Error is small enough.
Write a MATLAB script that does the following:
Prompts the user for the Number, N, to find the 4th root of Sets the initial guess to 1 Uses the algorithm describe above to repeatedly update the estimate until the value of Error does not exceed 0.0001. Saves all the values for Est in a vector Outputs the following:
The final value of the estimate for the 4th root of N. Use 4 decimal places. A count of how many iterations were required through the loop A plot with all the values for Est4
This is what I have so far:
N = input ('Enter the number: '); est = 1; error = abs(est.^4-N); while error > .0001; est = (est-((est.^4-N)/(4*est.^3))); error = abs(est.^4-N); end
Best Answer