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

3 ビュー (過去 30 日間)
Francesco
Francesco 2014 年 9 月 23 日
編集済み: Image Analyst 2014 年 9 月 23 日
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

回答 (1 件)

Jos
Jos 2014 年 9 月 23 日
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

カテゴリ

Help Center および File ExchangeLaTeX についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by