Import Text File Data With Blank Rows
Afficher commentaires plus anciens
I am having trouble importing a data set from a text file with blank rows. The data is in file "set1.txt" (attached) formatted as follows:
X data Y data
-----------------
1 5
2 7.8
3 2.1
X data2 Y data2
-----------------
1 2
2 2.4
3 8
When I use
G=importdata('set1.txt');
I have the first set of data contained in
>>G.data
ans=
1 5
2 7.8
3 2.1
Everything below the blank (empty) row is ignored. What I'd ultimately like to do is import each chunk of data into either its own n x 2 matrix, or, into an appended matrix such that all the data in set1.txt is imported into a matrix with the following format:
1 5 1 2
2 7.8 2 2.4
3 2.1 3 8
Any help would be much appreciated!
1 commentaire
per isakson
le 30 Avr 2014
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Text Files dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!