フィルターのクリア

concatenate data files horizontally into one file

1 回表示 (過去 30 日間)
Cody
Cody 2012 年 1 月 24 日
Hello,
I have several data files with the same number of rows and I need to concatenate them all into one big file. For example, we might have the following two files:
XX_X1_XXX.dat:
1 1
2 2
3 3
XX_X2_XXX.dat
4 4 4
5 5 5
6 6 6
XX_X3_XXX.dat
7
8
9
and I want to concatenate data files into one horizontally into one file like below.
Bigdata.dat
1 1 4 4 4 7
2 2 5 5 5 8
3 3 6 6 6 9
Thanks a lot
  1 件のコメント
Walter Roberson
Walter Roberson 2012 年 1 月 24 日
duplicate is at http://www.mathworks.com/matlabcentral/answers/26882-concatenate-data-files-horizontally-into-one-file

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

回答 (1 件)

Thomas
Thomas 2012 年 1 月 24 日
load XX_X1_XXX.dat; % this will put the values in Variable X1
load XX_X2_XXX.dat; % this will put the values in Variable X2
load XX_X3_XXX.dat; % this will put the values in Variable X3
bigdata=[X1 X2 X3];

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by