Rotate 3D matrix
显示 更早的评论
Hi all :)
My problem seems to be quite simple but I can't figure it out somehow.
I have a 3D array size 376x376x30 and I would like to rotate it so that the dimensions are 30x376x376 instead.
Thanks for your help!
回答(1 个)
X = rand(2, 3, 4);
Y1 = permute(X, [3,1,2]);
size(Y1)
Y2 = permute(X, [3,2,1]);
size(Y2)
By the way, "matrix" means 2D by definition. You have a "3D array".
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!