How to Load Multiple Text Files Without Sequential Names
Ältere Kommentare anzeigen
Hi, I'm new to Matlab and I would dearly need your help!
I would like to load 30 text files, so each one can be red as a matrix and that I can make operations on them (loops, averaging, etc.), but I haven't found a way to load them all at once. Unfortunately, the spectrometer that I use create files like this :
1903395U1_04june19_154040_0001.Raw8.txt : which means "Measurements taken on June 4th, 2019 at 15 hours 40 min 40 seconds, take 0001"
1903395U1_04june19_154040_0002.Raw8.txt : which means "Measurements taken on June 4th, 2019 at 15 hours 40 min 40 seconds, take 0002"
1903395U1_04june19_154040_0003.Raw8.txt : which means "Measurements taken on June 4th, 2019 at 15 hours 40 min 40 seconds, take 0003"
1903395U1_04june19_154040_0004.Raw8.txt : which means "Measurements taken on June 4th, 2019 at 15 hours 40 min 40 seconds, take 0004"
1903395U1_04june19_154041_0001.Raw8.txt : which means "Measurements taken on June 4th, 2019 at 15 hours 40 min 41 seconds, take 0001"
My objective is to stock all "Columns 2" (only the values) of these text files into a pre-allocated matrix (i.e. Column 2 of the first file, Column 2 of the second file, Column 2 of the third file and so on...).
Column 2 (values of the first file) Column 2 (values of the second file) Column 2 (values of the third file) ........
1 2 3 .......
3 7 1 .......
... ... ... .......
Then, I need to average each row and stock the averaged value in another pre-allocated matrix and for example :
1 2 3 ....
3 7 1 ...
... ... ... ...
Averaging each row would give something like this :
2
3.66666666
...
What would be the best way to treat this problem in Matlab.
Thank you,
have a great day!
Akzeptierte Antwort
Weitere Antworten (1)
Ragda2
am 24 Jan. 2020
0 Stimmen
i couldn't get the files paths can anyone know why?
Kategorien
Mehr zu Variables finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!