For example, A = [19 20 21 22 23 24 25];
B = [2 0 3 0 0 0 2];
How can we get a new array, repeating each value from B accordingly X times?
For example, answer here is: [19 19 21 21 21 25 25]
.
Please note that I am only allowed to a for
loop combined with a repmat
call.