collect.(Tuple.(ind))
2×2×2×2 Array{Array{Int64,1},4}:
[:, :, 1, 1] =
[1, 1, 1, 1] [1, 2, 1, 1]
[2, 1, 1, 1] [2, 2, 1, 1]
[:, :, 2, 1] =
[1, 1, 2, 1] [1, 2, 2, 1]
[2, 1, 2, 1] [2, 2, 2, 1]
[:, :, 1, 2] =
[1, 1, 1, 2] [1, 2, 1, 2]
[2, 1, 1, 2] [2, 2, 1, 2]
[:, :, 2, 2] =
[1, 1, 2, 2] [1, 2, 2, 2]
[2, 1, 2, 2] [2, 2, 2, 2]
Tuple.(ind)[:]
16-element Array{NTuple{4,Int64},1}:
(1, 1, 1, 1)
(2, 1, 1, 1)
(1, 2, 1, 1)
(2, 2, 1, 1)
(1, 1, 2, 1)
(2, 1, 2, 1)
(1, 2, 2, 1)
(2, 2, 2, 1)
(1, 1, 1, 2)
(2, 1, 1, 2)
(1, 2, 1, 2)
(2, 2, 1, 2)
(1, 1, 2, 2)
(2, 1, 2, 2)
(1, 2, 2, 2)
(2, 2, 2, 2)
collect.(Tuple.(ind))[:]
16-element Array{Array{Int64,1},1}:
[1, 1, 1, 1]
[2, 1, 1, 1]
[1, 2, 1, 1]
[2, 2, 1, 1]
[1, 1, 2, 1]
[2, 1, 2, 1]
[1, 2, 2, 1]
[2, 2, 2, 1]
[1, 1, 1, 2]
[2, 1, 1, 2]
[1, 2, 1, 2]
[2, 2, 1, 2]
[1, 1, 2, 2]
[2, 1, 2, 2]
[1, 2, 2, 2]
[2, 2, 2, 2]
cat(collect.(Tuple.(ind))...,dims=2)
4×16 Array{Int64,2}:
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2
1 1 1 1 2 2 2 2 1 1 1 1 2 2 2 2
1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2