Reading data with specific format
Ältere Kommentare anzeigen
I have a text file something similar to below.
Time
10
Atoms
100
1 2 .1 .3 .4
2 1 .4 .6 .7
3 1 .5 .6 .8
Time
20
Atoms
100
1 2 .5 .6 .4
2 1 .4 .6 .9
3 1 .5 .6 .4
Time
30
Atoms
100
1 2 .5 .6 .4
2 1 .4 .7 .9
3 1 .7 .6 .1
Time
............
............
The text file is repeated for many times. Now I want to extract the data which is in the format of '%f%f%f%f%f'. i.e I need to generate an matrix as below.
[1 2 .1 .3 .4
2 1 .4 .6 .7
3 1 .5 .6 .8
1 2 .5 .6 .4
2 1 .4 .6 .9
3 1 .5 .6 .4
1 2 .5 .6 .4
2 1 .4 .7 .9
3 1 .7 .6 .1
............
...........]
How to do that without using loop?
Thanks
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Import and Export 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!