I'm trying to combine two vectors, using one element from each per step.
Say A = [1,3,5] and B = [ 2,4]
I would like to combine them to C =[1,2,3,4,5]
Vectors A and B can either be equal of length or differ by maximum of 1.
One can also be empty and the other of size 1.
I have tried various solutions I found online but Mathlab throws "Error using vertcat/horzcar", since sometimes the vectors differ in length.
Thanks in advance!
Best Answer