How to turn a matrix into a Multidimensional Array?

for example if I have:
>> A=[2 8; 0 5]
A =
2 8
0 5
and I want to separate each row so that A=
A(:,:,1) =
2 8
A(:,:,2) =
0 5

 採用された回答

Andrei Bobrov
Andrei Bobrov 2013 年 10 月 28 日
編集済み: Andrei Bobrov 2013 年 10 月 28 日

1 投票

permute(A,[3 2 1])
or
reshape(A.',1,size(A,2),[])

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

質問済み:

2013 年 10 月 28 日

編集済み:

2013 年 10 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by