Using while ~feof(fid) - Subscripted assignment dimension mismatch.
이전 댓글 표시
I need to read and extract the data from my file (I have attached it). In order to do this I made this function:
function [obs] = readRINEXobs()
%Opening the selecting menu
[file,path] = uigetfile('*.**o');
%Opening the file
fid = fopen(strcat(path,file),'r');
%Reading until END of HEADER
tline = fgets(fid);
while (~strcmp(tline(61:63),'END'))
tline = fgets(fid);
end
tline = fgets(fid);
sat=tline;
index=strfind(tline,'G');
[~,n]=size(index);
while ~feof(fid)
for i=1:n
A(1,i)=str2num(sat(index(i)+1:index(i)+2));
tline = fgets(fid);
A(2:6,i) = sscanf(tline,'%f');
tline = fgets(fid);
A(7,i) = str2num(tline);
end
end
obs.data=A;
end
But I get this error
Subscripted assignment dimension mismatch.
Error in readRINEXobs (line 25)
A(2:6,i) = sscanf(tline,'%f');
The lines of the blocks of data are not constant, some blocks have 7 lines, some have 8, 9 and so on. Anyone can help me?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!