For those of us who are not as smart as Mason
, the TensorCast package is perhaps more within reach:
using TensorCast
A = rand(3,3,5,10)
@cast B[k,l]{i,j} := A[i,j,k,l]
NB:
the curly brackets are used for the static array slices of desired output: 5x10 Matrix of SMatrix{3,3}