How can I read a txt file and put the values in a matrix, skipping the first rows?
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 LaTeX 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!