I want to combine
A = [1 3 5 7 9];
B = [2 4 6 8 10];
into
C = [1 2 3 4 5 6 7 8 9 10];
I made an interlacing for-loop like this:
for i=1:length(A)
C(2*i-1) = A(i);
C(2*i) = B(i);
end
Is there a better way to interleave than this? perhaps without doing any loop?