Prevent Matlab from rounding output?
问题 Im running a simple script to estimate roots for a function. Everything works great, each iteration of the algorithm prints off the current x and f(x), but when the script finishes and sets the final estimate of x as the output of the function the value is returned and rounded to 3 decimal places... while k < maxit k = k + 1; dx = b - a; xm = a + 0.5*dx; % Minimize roundoff in computing the midpoint fm = feval(fun, xm, diameter, roughness, reynolds); fprintf('%4d %12.20e %12.4e\n',k,xm,fm);