Importing data from a complex text file
이전 댓글 표시
Greetings
I'm fairly inexperienced in MATLAB and I've got a rather difficult problem on my hands. I need to import a set of numbers from a text file. The sample of a text file is on the link: https://www.dropbox.com/s/oexzfcdrfyj8n2n/FSB32E15M-L20.txt?dl=0
As you can see, numbers are arranged in groups. Each group consists of 512 pairs of numbers closed in brackets. I need to import these numbers into MATLAB in a following way: Each group of numbers will make two vectors, for example, X1 and Y1. The first number in bracket will go into the X1 vector, and the second number in bracket will go into the Y1 vector. For example, if the text file says: (2029,0),(2034,0),(1998,0)... my vectors will be:
X1 = [2029 2034 1998 ....]
Y1 = [0 0 0 ....]
And since the file has 25 groups of numbers, I should end up with 50 vectors. X1-X25 and Y1-Y25. Every other text in the file is to be ignored.
Any suggestions on how to do this will be appreciated :)
Btw., not everything needs to be automated or 100% efficient. I can do some manual work if it means having a much simpler code.
댓글 수: 2
Guillaume
2015년 6월 5일
You can dismiss the prompt(s) to sign in into dropbox and access the file nonetheless. I agree, attaching it here makes it more accessible.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Text Data Preparation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!