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

 Accepted Answer

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

More Answers (0)

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Asked:

on 28 Oct 2013

Edited:

on 28 Oct 2013

Community Treasure Hunt

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

Start Hunting!