MATLAB: How to extend array

extend array

I want to extend an array like this:
A = [1 2 3 4];
B = [2 3 5 7];
C =[1 1 2 2 2 3 3 3 3 3 4 4 4 4 4 4 4];
How could I do that?

Best Answer

repelem(A,B)
Related Question