function MO()

N = 100000;

T{1} = [1/3 0 0; 0 1/3 0; 0 0 1] ; % Bottom Left Square

T{2} = [1/3 0 1/3; 0 1/3 0; 0 0 1] ; % Bottom Center Square

T{3} = [1/3 0 2/3; 0 1/3 0; 0 0 1] ; % Bottom Rightt Square

T{4} = [1/3 0 0; 0 1/3 1/3; 0 0 1] ; % Mid Left Square

T{5} = [1/3 0 2/3; 0 1/3 1/3; 0 0 1] ; % Mid Right Square

T{6} = [1/3 0 0; 0 1/3 2/3; 0 0 1] ; % Top Left Square

T{7} = [1/3 0 1/3; 0 1/3 2/3; 0 0 1] ; % Top Center Square

T{8} = [1/3 0 2/3; 0 1/3 2/3; 0 0 1] ; % Top Right Square

X = zeros(3,N); % memory for the points

X(:,1) = [0.1; 0.1; 1]; % initial point (column 1, row x and row y)

for i = 1:N-1

Rule = floor(8*rand)+1;

X(:,i+1) = T{Rule}*X(:,i);

end

figure(1);

set(gcf, 'color', 'white'); % Sets the background Color of the plot to white

% plots all points at the end

% Pick yourt preferred Dot Color from combining (0 to 1 values)

% [ r g b ] = [red green blue];

% [0 0 0] = black,

% [1 1 1] = white,

% [1 0 0 ] = red,

% [0 1 0 ] = green,

% [0 0 1 ] = blue, etc.

% What color is [0.5 0.5 0.5 ] = ?

plot(X(1,:),X(2,:),'.','Color',[0 0 1 ],'MarkerSize',2);

axis off;

end