clear;
clc;

iterations = 100;
x1 = 0.2;
x2 = 0.2 + 10^(-6);
y1vals = [x1];
y2vals = [x2];
a = 4;

for i = 1:iterations
    x1 = quad_iterator(x1,a);
    y1vals = [y1vals x1];
end    

for i = 1:iterations
    x2 = quad_iterator(x2,a);
    y2vals = [y2vals x2];
end    

figure(1)
plot(1:iterations+1, y1vals, '.-');
ylim([0 1]);
xlim([0 iterations+3]);
title('x0 = 0.3')

figure(2)
plot(1:iterations+1, y2vals, '.-');
ylim([0 1]);
xlim([0 iterations+3]);
title('x0 = 0.2')

figure(3)
plot(1:iterations+1, abs(y2vals - y1vals), '.-');
xlim([0 iterations+3]);
