Illegal use of reserved keyword "else".

2 次查看(过去 30 天)
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 中查找有关 Cartesian Coordinate System Conversion 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by