置换和重塑多维数组的替代较短方法

Alternative shorter method to permute and reshape a multidimensional-array

我有以下多维数组:

a(:,:,1) =
    11    12    13
    21    22    23

a(:,:,2) =
    21    22    23
    31    32    33

a(:,:,3) =
    31    32    33
    41    42    43

最终结果如下所示:

e =
    11    21    31
    12    22    32
    13    23    33
    21    31    41
    22    32    42
    23    33    43

为了获得数组e,我做了以下操作:

b=permute(a,[2,1,3])  
c=reshape(b,1,6,[])  
d=permute(c,[2,1,3])

是否有更简洁或更优雅的方法来实现相同的结果?

这里使用了一次排列:

b = permute(a,[2 1 3]);
result = reshape(b, [], 3)

您可以按照以下方式进行操作:

reshape([a(:,:,1);a(:,:,2);a(:,:,3)].',6,3)