If I have a vector a
00110 0
and a vector b
56
and I want to input the data of b into the nonzero elements of a (which will always be together and matching the dimensions of b), so that vector c reads
005600
What is an easy way to do this? Thank you!
Another example that it needs to work for:
a b c_ _ _0 4 00 8 01 3 ----> 41 7 81 3 1 7
Best Answer