How to turn a matrix into a Multidimensional Array?

조회 수: 6 (최근 30일)
Tristan
Tristan 2013년 10월 28일
편집: Andrei Bobrov 2013년 10월 28일
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일
permute(A,[3 2 1])
or
reshape(A.',1,size(A,2),[])

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by