If n is the number whose 5th root has to be calculated:
function f = fifth_root(n)
xold=10;
for i = 1:100
xnew = xold - (xold*xold*xold*xold*xold-n)/(5*xold*xold*xold*xold);
xold=xnew;
end
f=xnew
end
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!