I am getting Undefined function or variable 'A', error in Untitled line 95
이전 댓글 표시
fileid = fopen('RINEX.txt');
while ~feof(fileid)
y = fgetl(fileid);
a = strfind(y,'END OF HEADER');
if a>0
break;
end
end
% -------------------------------------------------------------------------
% -------------------------------------------------------------------------
% Reading the Data Section
% -------------------------------------------------------------------------
% -------------------------------------------------------------------------
f1 = (1575.42*1e6);
f2 = (1227.60*1e6);
m = 0;
r = 0;
while ~feof(fileid)
try
y = fgetl(fileid);
disp(y);
if size(y,2)<35
disp('continuing')
continue
end
y1 = y(1,01:30);
numsat = str2num(y(:,31:32)); % Read the numbers of satellite
% ------------------------------------------------
timehr = str2num(y1(:,11:12)); % Read the hour
timemin = str2num(y1(:,14:15)); % Read the minute
timesec = str2num(y1(:,17:26)); % Read the second
if timemin==0
clc
disp('Processing data for the hour');
disp(timehr);
disp(timemin);
disp(timesec);
end
% --------------------------------------------------
y2 = y(1,33:end);
ys = y2;
if (numsat>12 && numsat<24)
y3 = fgetl(fileid);
ys = [ys y3];
end
if (numsat>24)
y4 = fgetl(fileid);
ys = [ys y4];
end
satnum = []; % Refresh this variable for every new read
c = 1;
for tt=1:size(ys,2)
if ( ys(tt)=='E' || ys(tt)=='G' || ys(tt)=='R')
ST(c) = ys(tt);
satnum(c) = str2num(ys(:,tt+1:tt+2)); % selecting the satellite numbers
tt = tt+2;
c = c+1;
end
end
% --------------------------------------------------
c = 0;
for j = 1:numsat
lin1 = fgetl(fileid);
lin2 = fgetl(fileid);
if (isempty(lin1) || isempty(lin2) || size(lin1,2)<63)
continue;
end
rangeL1 = str2num(lin1(:,35:46)); % read the range in L1
rangeL2 = str2num(lin1(:,51:63)); % read the range in L2
if (isempty(rangeL1) || isempty(rangeL2))
continue;
end
z = satnum(j); % find the satellite number of the current satellite
sod = timehr*3600 + timemin*60 + timesec; % get the current time in seconds of day
rr = round(sod/30)+1; % find the row number from the time
A(rr,:,z) = [sod,rangeL1,rangeL2]; % populate the corresponding page with the
current data
end
pause(1)
catch
disp('Error Encountered. Moving to next Data');
end
end
Den = ((1/f1.^2)-(1/f2.^2));
for jj = 1:size(A,3)
A(:,4,jj) = (A(:,2,jj)-A(:,3,jj))/40.3/Den/1e16;
end
댓글 수: 3
KSSV
2021년 9월 13일
We cannot help unless the input file is given. The error is clear, it says the variable A is not defined and you are trying to use it.
Dahati rafihna
2021년 9월 13일
Jan
2021년 9월 13일
Please post the complete error message. Do no let the readers count, which the "line 95" is.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Modulation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!