I'm having problems with the following task. I have a dummy array of zeros and 2 vectors of equal size. For example:
array1 = zeros(750,1);
vector1 = [1;3;5];
vector2 = [100;250;400];
I am looking to fill array1 as follows:
repeat element 1 in vector1 100 times
repeat element 2 in vector2 250 times
repeat element 3 in vector1 400 times
The resulting vector should have 7 rows and 1 column. I tried playing around with repmat but can't get it to output only 1 dimension. I also heard about bsxfun but I never end up with the data I need. I'm grateful for any useful suggestions.
I have Matlab 2013, so I'm not able to use the fancy function repelem that I found might be useful.