Why a script doesn't work by itself and just included in another script?
Show older comments
Hi there!
I have this script :
fid = uigetfile('*.sp3');
fid=fopen(fid);
fmt=[sat repmat('%f ',1,8)];
satSP3=[];
timpSP3=[];
while ~feof(fid)
l=fgetl(fid); % read a record
if l(1) =='*' % identificare timp pozitii sateliti
[p] = sscanf(l,'%c %d %d %d %d %d %d %d %d');
[gpsW,gpsS] = civil2GPStime (p(2), p(3), p(4), p(5), p(6), p(7));
end
%extragere pozitii pentru satelit X
if strfind(l,sat)
satSP3=[satSP3; cell2mat(textscan(l,fmt,'collectoutput',1))];
timpSP3 = [timpSP3; gpsS];
end
end
satSP3 = [satSP3(:,1:3) timpSP3];
fclose(fid);
When I press RUN I get this error :
Error in date_initiale_extragere_automata (line 4)
fmt=[sat repmat('%f ',1,8)];
And I have another script which includes the first one. When I run the second script I get no error. Could you please tell me where the problem is?
That's the script #2:
sat = 'PG04';
date_initiale_extragere_automata;
load_nav_param;
for i = 1:size(satSP3,1);
X = computemany(satSP3(i,4),toe,mo,a,deltan,e,omega,cuc,cus,crc,crs,io,idot,cic,cis,omegae,odot,omegao);
%nota bene in apelarea de mai sus am luat timpul din coloana a 4-a de
%pe linia curenta din satSP3
satEFEM (i,:) = X;
end
Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!