Put two columns matrix into 1 row matrix

5 ビュー (過去 30 日間)
Phong Pham
Phong Pham 2012 年 11 月 9 日
I have 2 file such as file1 and file2
file1 contains 52x1 matrix such as
x1
x2
etc
file 2 contains 52 x1 matrix such as
y1
y2
etc
Now I want two files to combine in one file with 1 row matrix in the order like
file 3= [ x1 y1 x2 y2 x3 y3 x4 y4 ... etc]
Anybody knows how to do it. Please helps . Thanks

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 11 月 9 日
x - your array [x1;x2;...]
y - your array [y1;y2;...]
xy = reshape([x, y].', 1, []);

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 9 日
編集済み: Azzi Abdelmalek 2012 年 11 月 9 日
x=[1;2; 3; 4;5]
y=[11 ; 22;33;44;55]
out=[x y]'
out=out(:)'

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by