function approx = root ( x ) % % function approx = root ( x ) % % ROOT uses 10 steps of Newton's method to approximate the square root of X. % approx = x; for i = 1 : 10 approx = 0.5 * ( approx + ( x / approx ) ); end