I have a huge data, with 7 colums and 20000 rows. I let Matlab to read mydata:
[tdata zdata kdata ldata mdata ndata pdata]=textread('mydata.txt')
But what I need is something else. I want to let Matlab to collect every 1000. Row from the data. Help to textread give an explanation for the first nth data:
[tdata zdata kdata ldata mdata ndata pdata]=textread('mydata.txt',n).
Is there any way to do this with a small change of textread format? Or should I write a for loop?
It’s probably easiest if you read all data, and crop away the unwanted data afterwards:
If the memory overhead is too large, or you find this unacceptable, you’ll have to write a loop with
fgetl, something along these lines: