Looping matrix into one column

2 ビュー (過去 30 日間)
Karlito
Karlito 2012 年 3 月 30 日
How would it be possible for me to create a single column from a matrix which has 5000 columns. I need each column to remain as they are. To get the mentioned matrix first place i'm using a for-loop. Do i have to define it in the loop then?

採用された回答

Thomas
Thomas 2012 年 3 月 30 日
doc reshape
Reshpae should do your job, try the following example
a=[1:4;5:8;9:12;13:16]
c=reshape(a,[],1)
  1 件のコメント
RNTL
RNTL 2012 年 3 月 30 日
column = matrix(:);

サインインしてコメントする。

その他の回答 (1 件)

Karlito
Karlito 2012 年 4 月 3 日
Thanks a lot, that worked like a charm!

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by