Filter löschen
Filter löschen

Rotate 3D matrix

28 Ansichten (letzte 30 Tage)
Johanna Popp
Johanna Popp am 18 Jun. 2021
Bearbeitet: Johanna Popp am 18 Jun. 2021
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!

Antworten (1)

Jan
Jan am 18 Jun. 2021
Bearbeitet: Jan am 18 Jun. 2021
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 Kommentar
Johanna Popp
Johanna Popp am 18 Jun. 2021
Thanks for your help!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by