I\'m trying to insert multiple values into an array using a \'values\' array and a \'counter\' array. For example, if:
a=[1,3,2,5] b=[2,2,1,3]
The performance problems in MATLAB's built-in repelem have been fixed as of R2015b. I have run the test_rld.m program from chappjc's post in R2015b, and repelem is now faster than other algorithms by about a factor 2:
repelem
test_rld.m