function [dtjpl]=yyyymmdd2dtjpl(yyyymmdd)
% function [dtjpl]=yyyymmdd2dtjpl(yyyymmdd)
%
% converts yyyymmdd (character format) into JPL date format
%
% yyyymmdd must be M x 6 character array
%
% e.g. 19990227 becomes 99FEB27

[M,N]=size(yyyymmdd);

if ~all(class(yyyymmdd)=='double')
    error('yyyymmdd must be class double');
end;
    
for i=1:M
%     yymmdds(i,:) = sprintf('%06.0f',yymmdd(i));
    

    yyyy = fix(yyyymmdd(i)/10000);
    mm = fix((yyyymmdd(i) - yyyy*10000)/100);
    dd = yyyymmdd(i) - yyyy*10000 - mm*100;
    hh = 0;
    min = 0;
    sec = 0;
    dtval = [yyyy mm dd hh min sec];
    MMM = uppercase(datestr(dtval,3));
    YY = sprintf('%02.0f', yyyy - fix(yyyy/100)*100);
    DD = sprintf('%02.0f',dd);
    dtjpl(i,1) = {[YY MMM DD]};
    
end;
