How can I replicate elements of a vector of into another?
v1=ones(12,1);v2=[1 1 1 1 3 1 4]
I would like to get a v3 of the same length of v1 with replicated elements of v2. Something like this:
v3=[1 1 1 1 3 3 3 1 4 4 4 4]
Thanks!
duplicate elements in vectorrepeat elements
v1=ones(12,1);v2=[1 1 1 1 3 1 4]
v3=[1 1 1 1 3 3 3 1 4 4 4 4]
Best Answer