I need some help to map elements from a short vector to a larger vector in Matlab. I can do this with a for-loop, but I'm sure there's a way to avoid this.
I have input vectors of same size: A = [ 2 3 5 ] and B = [ 0.1 0.3 0.23 ]. Vector A contains "index" and vector B data. A third input vector is given as C = [ 2 2 2 3 3 3 3 5 5 ] and now I want to generate the vector D = [ 0.1 0.1 0.1 0.3 0.3 0.3 0.3 0.23 0.23 ].
How can I, in Matlab, generate vector D, without using for-loops?
Thank you in advance!