while 1 and fget1 loop.
Show older comments
fide = fopen('data.13o')
head_lines = 0
while 1
head_lines = head_lines+1
line = fgetl(fide)
answer = findstr(line,'END OF HEADER')
if ~isempty(answer), break; end
end
% the header of the data.13o file is;
OBSERVATION DATA M RINEX VERSION / TYPE
LEICA GEO OFFICE 5.0 10-5-13 10:45 PGM / RUN BY / DATE
OBSERVER / AGENCY
O2930689 MARKER NAME
O2930689 MARKER NUMBER
P8UO0W21QTC -Unknown- -Unknown- REC # / TYPE / VERS
-Unknown- TPSGR3 NONE ANT # / TYPE
4303634.7047 2746069.9471 3812585.4149 APPROX POSITION XYZ
1.3289 0.0000 0.0000 ANTENNA: DELTA H/E/N
L1PhaOff: 0.2338 L2PhaOff: 0.2252 COMMENT
1 1 WAVELENGTH FACT L1/2
7 C1 P1 L1 D1 P2 L2 D2 # / TYPES OF OBSERV
2013 4 13 4 56 30.000000 TIME OF FIRST OBS
2013 4 13 7 59 0.000000 TIME OF LAST OBS
16 LEAP SECONDS
27 # OF SATELLITES
END OF HEADER
%this loop works what it supposed to be but I couldn't understand how "while 1" works for this loop and what's the difference between "while 1" and while for the loop.
Accepted Answer
More Answers (1)
d bhaskar
on 17 Feb 2023
0 votes
a=1;
while 1
a=a+1;
if(a>100) break
end
end
Categories
Find more on Code Performance 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!