Effacer les filtres
Effacer les filtres

How can I read a txt file and put the values in a matrix, skipping the first rows?

3 vues (au cours des 30 derniers jours)
Francesco
Francesco le 23 Sep 2014
Modifié(e) : Image Analyst le 23 Sep 2014
Hi to everyone,
I'm trying to read a txt file (ex. trial.txt) with matlab and put the value into a matrix without success. The text file is made up as follow:
(title "xxxxx")
(labels "Position" "xxxxxx")
((xy/key/label "line-a2")
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
My problem is to skip the first rows. Can someone help me?
thanks in advance

Réponses (1)

Jos
Jos le 23 Sep 2014
M=dlmread('trial.txt','',skipRows,skipColumns)
where skipRows is the number of rows you don't want to read at the start of your file and skipColumns is the number of columns you want to skip from the left hand side

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by