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 (최근 30일)
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;

답변 (1개)

Walter Roberson
Walter Roberson 2018년 1월 22일
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.

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by