MATLAB: Creating a vector where the column number repeated x number of times where x is the element of another vector

MATLABrepeating columnsrepmat

Is there a quick way to create Vetor B from vector A, where the column number of vector A is repeated x number of times where x is the element of vector A.
Such as gettin B from A where,
A = [3 ; 4 ; 5] to B = [1 ; 1 ; 1 ; 2 ; 2 ; 2 ; 2; 3 ; 3 ; 3 ; 3 ; 3]
(In the example of B above, 1s are repeated 3 times, 2 are repeated 4 times, and 3s are repeated 5 times)

Best Answer

Use repelem()