You are on page 1of 2

close all

clear

clc

%p = zeros(12,7);

p(1,:) = [1 0 0 0 0 0 0];

for i=1:20

if p(i,1)==1

p(i+1,2)=1;

end

if p(i,2)==1

p(i+1,3)=1;

end

if p(i,3)==1

p(i+1,4)=1;

end

if p(i,4)==1

p(i+1,5)=1;

p(i+1,7)=1;

end

if p(i,5)==1 && p(i,7)==1

p(i+1,6)=1;

p(i+1,8)=1;

end

if p(i,6)==1 && p(i,8)==1

p(i+1,1)=1;
end

end

You might also like