maybe this is a easy question, but is there a fast way to duplicate elements in a array? It should work like this way for 3D:
1 2 3
4 5 6
7 8 9
1 1 2 2 3 3
1 1 2 2 3 3
4 4 5 5 6 6
4 4 5 5 6 6
7 7 8 8 9 9
7 7 8 8 9 9
I tried it with 3 nested for-loops, but this was really slow.