How to turn a matrix into a Multidimensional Array?
5 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
Andrei Bobrov
on 28 Oct 2013
Edited: Andrei Bobrov
on 28 Oct 2013
permute(A,[3 2 1])
or
reshape(A.',1,size(A,2),[])
0 Comments
More Answers (0)
See Also
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!