fgets
fgets(fileid) reads next line in file corresponding to fileid. -1 is returned if end of file has been reached.
Note that fileid has to be opened in read mode for fgets to work properly.
Note that fileid has to be opened in read mode for fgets to work properly.
Examples
> X = rand(2,3)# 0.250924 0.0460958 0.676816 0.680573 0.320973 0.155359 > csvwrite('randnumbers.txt',X) [ans:1] > fileid = fopen('randnumbers.txt','r') [fileid:3] > fgets(fileid)# 0.2509236186742783,0.04609582107514143,0.6768162436783314 > fgets(fileid)# 0.6805727265309542,0.3209733893163502,0.1553593429271132 > fgets(fileid)# -1