Read text file containing string and numeric data
조회 수: 1 (최근 30일)
이전 댓글 표시
I would like read the following text file that has column values with string and numeric data. Problem is the numeric column is mixed with 'N/A'. After reading, I like to use data from column 8 and 11. I'm using R2010b.
댓글 수: 0
채택된 답변
Matt Fig
2012년 11월 15일
fid = fopen('Test.txt');
C = textscan(fid,repmat('%s',1,19),'Headerlines',1)
fclose(fid)
HeadDiam = str2double(C{8});
TYPE = C{11};
Note that when using STR2DOUBLE, those N/As are converted to NaNs
추가 답변 (1개)
Abirami M
2020년 3월 11일
Use this Url and how to read and preprocess this kind of text data in matlab.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!