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 Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by