Reading multiple non-sequential *.txt files containing both text and numbers
Mostrar comentarios más antiguos
Hi everyone,
I'm a bit struggling with importing large number of text files into Matlab. I think the bit I'm having difficulty is "delimeter" and number of columns in each file where it starts with 2 column then 3 on the second line then 2 in the rest. I've tried textscan, load and importdata so far but had no luck.
On a seperate note, I do not need the text, I just need the numbers to be imported.
To give you a deeper insight, I attach the some of the files. These are the first batch. The second batch of files comes with a name:
- beta_1_kappa_05_cbeta2_1.txt
- beta_1_kappa_05_cbeta2_5.txt
- beta_1_kappa_05_cbeta2_10.txt
- beta_1_kappa_05_cbeta2_20.txt
- beta_1_kappa_05_cbeta2_30.txt
However, the third batch does not include "..cbeta3_30.txt", therefore this batch looks something like this:
- beta_1_kappa_05_cbeta3_1.txt
- beta_1_kappa_05_cbeta3_5.txt
- beta_1_kappa_05_cbeta3_10.txt
- beta_1_kappa_05_cbeta3_20.txt
Then, the following batches loop for "kappa" for kappa=10, 15, 20 as in kappa_10, kappa_15 and kappa_20. Finally, everything will loop for beta_2 and beta_3.
I hope what I'm trying to achive is clear, and I can get some help.
Cheers.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Conversion 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!