MATLAB: Import and combine multiple XYZ.txt data files into one X, Y and Z column vectors

data importimporttext file

Hi
I have a large number of txt files with different names, each one has tab seperated values of X Y and Z data in 3 columns. I have been importing each file seperately but there must be a way to import all the files at once into just 3 column vectors? The files themselves are very large. Is it also possible to write the data into one txt file?
Any help on this would be much appreciated.
Thanks

Best Answer

I don't think you can import all the files at once, but you can do so in a loop and append the data from each file to what has already been imported by concatenating the arrays. See the MATLAB FAQ for more details.
HTH,
Arnaud
Related Question