Extracting specific column of values using regexp
조회 수: 2 (최근 30일)
이전 댓글 표시
I am currently trying to extract the X, Y, Z values from a .txt file. Any help is greatly appreciated!
댓글 수: 3
Guillaume
2016년 9월 6일
Rather than a screenshot of a text file (with which we can't experiment), attach an actual file.
답변 (1개)
Guillaume
2016년 9월 6일
Your text file looks fairly ordinary. Matlab shouldn't have much problem importing using one of its many functions. Probably, the simplest would be to use readtable.
Without a file, I can't test but I believe
t = readtable('yourfile', 'HeaderLines, 1, 'Delimiter', 'tab')
should work, assuming you give it the right delimiter.
댓글 수: 1
Stephen23
2016년 9월 6일
@Dhani Dharmaprani: it is usually much faster and simpler to read all of the data, and then use basic MATLAB indexing afterwards to select that data that you need.
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!