function x = fixed(f, x0, tol, maxiter) x(1) = x0; for i = 2:maxiter x(i) = f(x(i-1)); if abs(x(i) - x(i-1)) < tol break; end end end