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?

 采纳的回答

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
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