read data from files in a loop and append into one array
Mostrar comentarios más antiguos
Hi,I have a number of files, each contains 2columns but varies number of rows.
I set up a loop to read the data from each of them. Now, I want to put the read-out-data append to an array (so at the end the array will have n-rows x 2-columns). how can I do that please? below I have listed the code I have for reading the data. Many thanks.
filenum = 2;
for i=1:filenum
f = load(['output_' num2str(i) '.txt']) %load the datafiles:
%output_1.txt, output_2.txt,...etc
%here, want to add all the 'f' here into an array
end
example: file1
11 22
33 44
file2
22 33
55 66
77 88
array want:(if call it NewArray)
NewArray =
11 22
33 44
22 33
55 66
77 88
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 10 de Jul. de 2016
0 votos
Categorías
Más información sobre Data Types en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!