clear
clf;

x = 0:0.01:1;
y = sin2(x);             % NEW: this is a call to your own function

axes('FontSize',20);
plot(x,y,'LineWidth',5); % plot 1
pause                    % waits until you press RETURN

x = 0.2;  % starting point for iteration
for i = 1:10
    xx(i) = i;
    yy(i) = x;
    x = sin2(x) % assign the next value in the iteration to 'x'
end

plot(xx,yy,'r.','Markersize',20); % plot 2

