Rotate 3D matrix

12 ビュー (過去 30 日間)
Johanna Popp
Johanna Popp 2021 年 6 月 18 日
編集済み: Johanna Popp 2021 年 6 月 18 日
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 件)

Jan
Jan 2021 年 6 月 18 日
編集済み: Jan 2021 年 6 月 18 日
X = rand(2, 3, 4);
Y1 = permute(X, [3,1,2]);
size(Y1)
ans = 1×3
4 2 3
Y2 = permute(X, [3,2,1]);
size(Y2)
ans = 1×3
4 3 2
By the way, "matrix" means 2D by definition. You have a "3D array".
  1 件のコメント
Johanna Popp
Johanna Popp 2021 年 6 月 18 日
Thanks for your help!

サインインしてコメントする。

カテゴリ

Help Center および File Exchange3-D Scene Control についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by