Suppose I have an array:
julia> a = [1 1; 2 2; 3 3; 4 4; 5 5; 6 6; 7 7;]
7×2 Array{Int64,2}:
1 1
2 2
3 3
4 4
5 5
6 6
7 7
And I make a vector that specifies how many times each row gets repeated in the new array:
julia> r = [0; 2; 0; 4; 0; 1; 0;]
7-element Array{Int64,1}:
0
2
0
4
0
1
0
The output that I want is:
julia> a_repeated = [2 2; 2 2; 4 4; 4 4; 4 4; 4 4; 6 6;]
7×2 Array{Int64,2}:
2 2
2 2
4 4
4 4
4 4
4 4
6 6
How do I get there? I thought I would use the repeat function, but I can't seem to understand how inner and outer work.