how can make a matrix from many vectors?

how can make a matrix from many vectors?

3 件のコメント

sixwwwwww
sixwwwwww 2013 年 10 月 18 日
Are all the vectors of same length?
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 18 日
You should precise column vectors or row vectors?
fatemeh
fatemeh 2013 年 10 月 18 日
yes row vectors with same size 1*2,actually i have a for loop and it each time produce a vector with size 1*2 ,i want save this vector each time to a matrix

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

回答 (3 件)

vaishali
vaishali 2013 年 10 月 18 日

1 投票

C = horzcat(A1, A2, ...) horizontally concatenates matrices A1, A2, and so on. All matrices in the argument list must have the same number of rows
Jos (10584)
Jos (10584) 2013 年 10 月 18 日
編集済み: Jos (10584) 2013 年 10 月 18 日

1 投票

... and if the vectors are not of the same lengths, you can use PADCAT
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 18 日

0 投票

out=[A1;A2;A3;...]

1 件のコメント

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 18 日
編集済み: Azzi Abdelmalek 2013 年 10 月 18 日
out=zeros(1000,2) % Pre-allocate
for k=1:1000
out(k,:)=... % your calculations
end

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

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2013 年 10 月 18 日

コメント済み:

2013 年 10 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by