标签: matlab matrix multidimensional-array reshape
我有一个维度的三维矩阵:427x470x48
我想将其重塑为维度的二维矩阵:48x200690
这意味着旧的(1,1,:)会对应新的(:,1)
此外,旧(1,2,:)将对应于新的(:,2),依此类推。
谢谢
答案 0 :(得分:3)
执行:
new = reshape(permute(old, [3 2 1]), 48, []);
你也可以粗略地检查它们是否相同:
numel(intersect(old(1,1,:),new(:,1))) == 48;