repelem substitute for older matlab version
24 views (last 30 days)
I want to do the following (what usually repelem does, however an older version of Matlab does not seem to have it):
Given vector a = [3 45 6 ];
I would want for instance its first element to be repeated 2 times, the second 4 times, the third element once (just as an example). So we would end up with:
aNew = [3 3 4 45 45 45 6 6];
How can that be done in a systematic way without repelem?