Planet id number from name.

%--------------------------------------------------------------------------
%   Copyright (c) 2018 Princeton Satellite Systems, Inc.
%   All rights reserved.
%--------------------------------------------------------------------------
%   Since 2018.1
%--------------------------------------------------------------------------

planet  = {'sun' 'Earth' 'Moon' 'Charon'};
id      = PlanetId(planet);
for k = 1:length(id)
  fprintf(1,'The planet id for %s is %d\n',planet{k},id(k));
end

%--------------------------------------
Warning: Charon not available 
The planet id for sun is 0
The planet id for Earth is 3
The planet id for Moon is 10
The planet id for Charon is NaN