Mon 26 Jun 2017 03:04:01 PM UTC, comment #3:
Thanks for the explanation, I'll be able to adapt to the current version now.
I'd like to ask about the documentation as I understand it that textscan does handle lines.
Octave 4.0.3 documentation:
-- Function File: C = textscan (FID, FORMAT, N)
...
"When reading from file, N specifies the number of data lines to read; in this sense it differs slightly from the format repeat count in strread."
Octave 4.2.1 documentation and https://octave.sourceforge.io/octave/function/textscan.html:
C = textscan (fid, format, repeat)
...
The optional numeric argument REPEAT can be used for limiting the
number of items read:
...
N
Read until the first of two conditions occurs:
1) the format has been processed N times, or
2) N lines of the input have been processed.
p.s. I do not have easy access to a Matlab system right now.
p.p.s.: I tried to build a workaround which unfortunately does skip empty lines (worked around that as well):
line = textscan(fid, '%s', 1, "Delimiter", "\r\n");
words = strsplit(line{1}{1}, {" ", "\t"});
|