function k=goodmenu(s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16)
% function k=goodmenu(s0,s1,...,s16) calls menu and checks for good answer
% Goodmenu calls menu but checks to make sure the response is reasonable.
% s0 is placed in the menu heading.  The rest of the sk's give the
%   options.  Up to 16 options can be given.
% JWD
%
if nargin<2
   k=0;
else
   menustr='k=menu(s0';
   for num0=1:nargin-1
      menustr=[menustr ',s' int2str(num0)];
   end
   menustr=[menustr ');'];
   k=0;
   sza1=1;
   sza2=1;
   while k<1|k>nargin-1|k~=ceil(k)
      eval(menustr)
      [sza1 sza2]=size(k);
      if sza1==0|sza2==0
         k=0;
      end
   end
end
return

