How to reshape a matrix

Hello , i've got a k by l by m by n by o matrix and i want to reshape it into a vector.. Any ideas?

 채택된 답변

James Tursa
James Tursa 2012년 9월 13일

0 개 추천

A = zeros(k,l,m,n,o);
B = A(:); % column vector
C = B.'; % row vector
For more general reshaping, see the reshape command.

추가 답변 (1개)

Matt Fig
Matt Fig 2012년 9월 13일
편집: Matt Fig 2012년 9월 13일

0 개 추천

A = rand(2,2,2,2);
B = A(:);
size(B)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by