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 で Resizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by