Illegal use of reserved keyword "else".

조회 수: 2 (최근 30일)
Ujjal Dey
Ujjal Dey 2016년 8월 25일
답변: Guillaume 2016년 8월 25일
if ( found )
[r, pclon, pclat] = cspice_reclat( point );
% Let re, rp, and f be the satellite's longer equatorial
% radius, polar radius, and flattening factor.
re = radii(1);
rp = radii(3);
f = ( re - rp ) / re;
[pdlon, pdlat, alt] = cspice_recgeo( point, re, f );
% Compute illumination angles at the surface point.
[phase, solar, emissn] = cspice_illum( satnm, et, ABCORR, scnm, point );
% Display results. Convert angles from radians to degrees
% for output.
fprintf( 'Intercept planetocentric longitude (deg): %11.6f\n',... R2D*pclon )
fprintf( 'Intercept planetocentric latitude (deg): %11.6f\n',... R2D*pclat )
fprintf( 'Intercept planetodetic longitude (deg): %11.6f\n',... R2D*pdlon )
fprintf( 'Intercept planetodetic latitude (deg): %11.6f\n',... R2D*pdlat )
fprintf( 'Range from spacecraft to intercept point (km): %11.6f\n',... dist )
fprintf( 'Range from spacecraft to target center (km): %11.6f\n',... norm(obspos) )
fprintf( 'Intercept phase angle (deg): %11.6f\n',... R2D*phase )
fprintf( 'Intercept solar incidence angle (deg): %11.6f\n',... R2D*solar )
fprintf( 'Intercept emission angle (deg): %11.6f\n',... R2D*emissn )
else
disp( ['No intercept point found at ' time ] )
end

답변 (1개)

Guillaume
Guillaume 2016년 8월 25일
Short answer: get rid of all the ...
Long answer: I assume that at some point, the stuff after the ... was on a second line. ... means two things: the rest of the line is a comment, the remaining of the instruction is on the next line. In effect, what you have written is:
fprintf('something', fprintf('somethingelse', fprintf('anothersomething', else
else is not valid in this context.

카테고리

Help CenterFile Exchange에서 Satellite Mission Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by