Effacer les filtres
Effacer les filtres

concatenate data files horizontally into one file

1 vue (au cours des 30 derniers jours)
Cody
Cody le 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 commentaire
Walter Roberson
Walter Roberson le 24 Jan 2012
duplicate is at http://www.mathworks.com/matlabcentral/answers/26882-concatenate-data-files-horizontally-into-one-file

Connectez-vous pour commenter.

Réponses (1)

Thomas
Thomas le 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];

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by