function [ lim init ] = basin( mu, f, x0, n ) %BASIN Summary of this function goes here % Detailed explanation goes here init = x0; lim = x0; hold off; plot(init,init,'--'); axis([init(1) init(end) init(1) init(end)]); hold on; plot(init,mu*f(init)); h = plot(init,lim,'.r','YDataSource','lim'); for j=1:n lim = mu*f(lim); refreshdata(h,'caller'); drawnow; pause(10/n); end hold off; end