Store for loop vector output into one column

Hi, I want to take the vector outputs of my for loop (which are 4x1) and store them into one big column vector. I got it to form a rectangular matrix, but I don't know how to make it into one big column.
Thanks

回答 (1 件)

Sean de Wolski
Sean de Wolski 2014 年 9 月 8 日

0 投票

doc reshape
Example:
m = magic(4)
v = reshape(m,[],1)
Or if nothing fancy is needed
v = m(:)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2014 年 9 月 8 日

回答済み:

2014 年 9 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by