function root = newton ( f, df, x ) FATOL = 0.000001; fx = feval ( f, x ); format long while ( abs ( fx ) > FATOL ) fp = feval ( df, x ); x = x - fx / fp; fx = feval ( f, x ); [ x, fx ] pause end root = x;