Dear all,
I'm learning to use fgetl and had followed the example that appears in the documentation:
fid = fopen('SomeFile.xxx');tline = fgetl(fid);while ischar(tline) disp(tline) tline = fgetl(fid);endfclose(fid);
The example works great, but I don't understand why I have to declare the tline again inside the loop.
If I don't do that it keeps looping for ever!
Can somebody explain me the reason?
Thanks,
Diego
Best Answer