How do I swap the dimensions of a 3D matrix?

조회 수: 49 (최근 30일)
Brucedai003
Brucedai003 2017년 3월 28일
편집: Brucedai003 2017년 3월 28일
For example, I have a 3D array A so that size(A) = [5, 2, 20]; How could I make it like [20, 2, 5] or [2, 5, 20], any order?
Edit: I didn't make it clear initially. A is 3-D, like a dice, I don't want to cut the dice and rearrange the data, instead I just want to roll the dice, so that I'm looking at this same dice just from a different angle.

채택된 답변

Walter Roberson
Walter Roberson 2017년 3월 28일
permute(A, [3 2 1])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by