for i=1:1:n
for j=i+1:1:n
lengthnum=length(robot1(i:j));
for k=1:1:n
if (lengthnum+k-1<=n)&&sum(robot1(i:j)==robot2(k:lengthnum+k-1))==lengthnum
sumcount(lengthnum)=sumcount(lengthnum)+1;
end
end
end
end
for i=1:1:n
for j=i+1:1:n
lengthnum=length(robot1(i:j));
for k=1:1:n
if (lengthnum+k-1<=n)&&sum(robot1(i:j)==robot2(k:lengthnum+k-1))==lengthnum
sumcount(lengthnum)=sumcount(lengthnum)+1;
end
end
end
end