How to import data from the following txt file into MATLAB?
Afficher commentaires plus anciens
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!
Réponse acceptée
Plus de réponses (1)
QI
le 15 Nov 2014
0 votes
1 commentaire
Star Strider
le 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.
Catégories
En savoir plus sur Low-Level File I/O dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!