i am trying to read data from a text file. The data are just lines with random words. im trying to skip the empty lines in this file and not load it. I use a loop with fgetl to load the data and the statement feof(fid)==0 to know when the end of the file is reached. I try use if isempty to skipe those lines. But the problem is that it also skips the line after the empty one. I think it is a problem within the loop. Is there another way to express feof(fid) so that it dosent conflict?
while feof(fid)==0 
    randomline=fgetl(fid) 
    if isempty(aline) 
        randomline=fgetl(fid) 
    else 
        %store data 
    end 
end