% function  input string and apply Caesar cipher
function   caesar0(varargin)
    if nargin == 1
       input_text=varargin{1};
       shift=3;  %classic Caesar code
    elseif nargin==2
       input_text=varargin{1};
       shift=varargin{2};
    else
       return;
   end
   % throw away all entries  excepts letters and spaces
   % convert all letters to uppercase
   counter=0;
   for k=1:length(input_text)
       letter=input_text(k);
       if letter ==32
           counter=counter+1;
           plain_text(counter)=letter;
       elseif (65<=letter)&&(letter<=90)
           counter=counter+1;
           plain_text(counter)=letter;
       elseif (97<=letter)&&(letter<=122)
           counter=counter+1;
           plain_text(counter)=letter-32;
       end        
   end 
   % show the modified text
   char(plain_text)
   % create new_text with shifted letters
   new_text = plain_text;
   for k=1:length(new_text)
       letter=new_text(k);
       if   (65 <= letter)&&(letter <= 90)
           new_text(k) = 65+mod(shift+letter-65,26);
       end % end if
   end % for k
   % save encrypted text to a file
   % use same name, but add '.caesar' to end
   out=char(new_text)
return
