Reading data with specific format
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Import and Export에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!