Filter löschen
Filter löschen

concatenate data files horizontally into one file

1 Ansicht (letzte 30 Tage)
Cody
Cody am 24 Jan. 2012
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 Kommentar
Walter Roberson
Walter Roberson am 24 Jan. 2012
duplicate is at http://www.mathworks.com/matlabcentral/answers/26882-concatenate-data-files-horizontally-into-one-file

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Thomas
Thomas am 24 Jan. 2012
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];

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by