Hello, I have a series of 300 files with names respectively from data-1.dat to data300.dat. Each file consist of 6 columns and 25 rows (files contain scalars with comma instead of dot, ex: 3,21223232 and a header line) I want to concatenate all files into one matrix and I'm using the code below:
% code
numfiles = 300; concat= cell(1, numfiles); for i=1:300; i filename = sprintf(data-%d.dat, i);
concat{i} = importdata(filename, '\t'); end the_struct = [concat{:}]; M = [the_struct.data];
For data that doesn't have a comma the code work very well, otherwise it doesn't. Anyhelpful answer is very welcome. Thank you in advance.
Best Answer