I would like to expand the size of 3D matrices by N times.
Take 2D example with N=3,
[1 2;
3 4]
should be transformed to
[1 1 1 2 2 2 ;
1 1 1 2 2 2;
1 1 1 2 2 2;
3 3 3 4 4 4 ;
3 3 3 4 4 4 ;
3 3 3 4 4 4 ]
Thanks very much.
Although the example is 2D, what I really need is a solution for 3D matrices. The function kron() does not work for 3D.