MATLAB: Read an empty line in a file

read an empty line in a file

hello everybody, I'm french so escuse me for my english… I've a problem, I have to read a file with matlab and it contains empty line for exemple :
<Node name="root" gravity='0 0 0' dt="0.01"
<EulerImplicitSolver name="cg_odesolver" printLog="0" etc etc
matlab read the first line and stop the reading . I did :
fid = fopen(name,'rt');
tline = fgetl(fid);
while (tline~=-1)
tline = fgetl(fid);
....
....
end
fgetl(fid) returns :
tline =
''
I don't know what I have to do… thnak you very much

Best Answer

Hi,
try it with feof in the while loop. See here for an example: