function p=fixedpoint_table(g,p0,tol,max_iterations) % Fixed point iteration: See section 2.2. % This version prints the iterations in a table. fprintf(' n | p_n | Delta-p(n-1) \n'); fprintf('---------------------------------\n'); for i=1:max_iterations % Store the previous iteration in p0. p=g(p0); fprintf('%2d | %+12.8f | %+12.8f\n', i, p, p-p0); if abs(p-p0)