I am recent purchaser of student version R2017b. Getting error in using fgetl(shown below). Opened the input file (rinex observation data) using fopen. Using fgets makes my code failed as I am working with the length of strings.Kindly help.

2 Ansichten (letzte 30 Tage)
Too many output arguments.
Error in fgetl (line 32)
[tline,lt] = fgetl(fid);
Error in readrinex (line 15)
line = fgetl(fid);
while ~feof(fid)
line = fgetl(fid);
if length(line)>33&&line(33)=='G',xx=line;
ns=str2double(xx(31:32));
for j=1:ns,
fprintf(fwr,'%d/%d/%d, %d:%d:%d, %s, ', str2double(xx(2:3)));
line1 = fgetl(fid);ll1=length(line1);
if ll1<1
for i=1:5,
fprintf(fwr,' NaN,\t');
end;
else
for i=1:16:ll1,
if i+14>ll1 && ll1==78, fprintf(fwr,'%s,\t',line1(i:end));
elseif line1(i:i+14)==' ',
fprintf(fwr,' NaN,\t');
else
fprintf(fwr,'%s,\t',line1(i:i+14));
end;
end;
end;

Antworten (1)

Walter Roberson
Walter Roberson am 22 Jan. 2018
What shows up for
which -all fgetl
The first entry should be under toolbox/matlab/iofun/fgetl.m and on line 32 of that file there is a call to fgets rather than to fgetl -- a call to fgetl from within fgetl would be recursion if it worked at all.

Kategorien

Mehr zu Low-Level File I/O finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by