I want to pick out some rows (in the vector vv, see below) from an array x. The ndims(x) is determined at run time.
So far, I use the approach illustrated below. Is there a better way?
x1 = [11 12 13;
21 22 23;
31 32 33]
x = cat(x1,x1.+100,dims=3) #my array, happens to be a 3D array this time
vv = [1,3] #rows to pick out
vc = Any[Colon() for i=1:ndims(x)]
vc[1] = vv #the rows to pick out
y = x[vc...] #the result