%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         7.gyakorlat         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Nemlin. din. rsz-ek alapjai %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          2015.11.04.        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%           Fraktálok         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure;
title('Cantor halmaz');
%pontok=linspace(0,1, 10); %[0,1] egyenest képezi le
pontok=rand %1 db random pontból indul
length(pontok)
ones(length(pontok))
plot(pontok, 0.1*ones(1, length(pontok)), 'b.');
xlabel('iteráció: 1');
xlim([0,1]);
ylim([0,2]);

hold on;

for i=2:20
    waitforbuttonpress;  
    pontok=[1/3*pontok, 1/3*pontok+2/3]; %az elõzõ egyeneseket leképezzük az 1. és utolsó harmadukra
    plot(pontok, 0.1*i*ones(1, length(pontok)), 'b.');
    xlabel(['iteráció: ', num2str(i)]);
    xlim([0,1]);
    ylim([0,2]);
end








