How to import data from the following txt file into MATLAB?
Ältere Kommentare anzeigen
Assume you have the txt file enclosed:
How to import only the data into MATLAB?
I have tried 'importdata', which also imports the strings into MATLAB. For instance, I use a1 = importdata('filename.txt'). Then in workspace, a1 reads as follows,
data < 1001*2 double >
textdata < 2*1 cell >
How can I extract only the data info and get rid of the textdata? Many thanks in advance!
Akzeptierte Antwort
Weitere Antworten (1)
QI
am 15 Nov. 2014
0 Stimmen
1 Kommentar
Star Strider
am 15 Nov. 2014
My pleasure! Cheers!
Just do isfinite on the data you read from the files and the NaN values disappear. You need do nothing else.
Kategorien
Mehr zu Low-Level File I/O finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!