I would like to interweave two vectors in MATLAB. In fact, I\'d actually just like to add a zero between each element, but I figured I\'d ask the question in such a way that
For the most simple case there's a quite "elegant" solution with a one-liner as described in this answer to a similar question.
a = [9 8 7];
b = [1 2 3];
output = kron(a, [1 0]) + kron(b, [0 1]);
As stated in the answer be aware that this is less efficient however might serve for a more general purpose than just interleaving as it uses the Kronecker product that is well-defined between two matrices.