MATLAB: How to replicate elements of a vector of into another

duplicate elements in vectorrepeat elements

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!

Best Answer

repelem(v2,v2)