You indicate that moves is 2 x n. Provided that n >= 2, length(moves) would be 2, as length() returns 0 if any dimension is 0 and otherwise returns max() of the dimensions.
Now that we know length(moves) is n, we know that moves(1,length(moves)) is moves(1,n) which is the scalar that is stored in the last column of the first row. So your vec is a scalar.
for arr = vec
is then looping setting arr to each column of the scalar vec. As vec is a scalar, that is only one column.
If you want to loop over all of the contents of the first row of moves, instead of
vec = moves(1,length(moves))
you should have
vec = moves(1,1:length(moves))
but really that should be
vec = moves(1, 1:size(moves,2))
in case moves has only 1 column.
Now, short-hand for moves(1, 1:size(moves,2)) is moves(1,:) so you can use
vec = moves(1, :);
