Hi,
I have a rather simple question on vector manipulation. I want to do some matrix manipulation as efficiently as possible and I think I found a solution, but therefore I have to do some vector manipulation. For example, I want to transform vector A into vector B:
A =
2 1 0 3
B =
1 1 2 4 4 4
So each element of A shows how many times the number 1,2,3,4… should be repeated. Is there a way to do this transformation in an efficient way without setting up a loop myself?
Thanks for your answer!
Best Answer