Read text file containing string and numeric data
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Debanjan Goswami
am 15 Nov. 2012
Beantwortet: Abirami M
am 11 Mär. 2020
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 Kommentare
Akzeptierte Antwort
Matt Fig
am 15 Nov. 2012
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
Weitere Antworten (1)
Abirami M
am 11 Mär. 2020
Use this Url and how to read and preprocess this kind of text data in matlab.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!