if o == 1;
if d <= length(D);
while d <= length(D);
W{w} = C{c} + D{d};
d = d + 1;
w = w + 1;
end
end
When you get out of that, d > length(D), either because d <= length(D) was originally false, or because the while loop incremented d until it became > length(D)
while true
if d > length(D);
The first time entering that loop, d > length(D) for the reasons described above
d = 1;
c = c + 1;
Suppose you just incremented c to be > length(C )
if c <= length(C);
so that is false
while d <= length(D);
so that is not done
W{w} = C{c} + D{d};
d = d + 1;
w = w + 1;
end
else
the else branch is taken because c > length(C)
o = o + 1
so o is incremented
end
end
end
You are inside a while true so you do the loop again. You assigned 1 to d the last time through, so d > length(D) is false, so you fall through to the bottom of the if and the end of the while true is immediately after that so nothing is done before starting the while true again. But d > length(D) is still false, so you do nothing before starting the while true again...
