Using while ~feof(fid) - Subscripted assignment dimension mismatch.
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Large Files and Big Data en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!