MATLAB:重塑 3D 矩阵的每个切片

MATLAB: Reshape every slice of a 3D matrix

是否可以使用矢量化而不是以下 for 循环解决方案来重塑 3D 矩阵的每个切片?

orig3D = rand(228,1,2);

for n = 1 : 2
    new3D(:,:,n) = reshape(orig3D(:,:,n), [12,19])';
end

Reshape and permute -

new3D = permute(reshape(orig3D, 12,19,[]),[2,1,3])