%

% Matlab routine to convert decimal degrees to degrees-minutes


%

% function [dmla,dmlo]=dd2dm(ddla,ddlo);

%

% d = degrees (whole number like 42)

% m = minutes (number + fraction of a minute 30.0)

% dd = decimal degrees (42.5)

%

function [dmla,dmlo]=dd2dm(ddla,ddlo)
for i=1:length(ddla);
  if ddlo(i)>=0;
    dlo=floor(ddlo(i)); 
  else 
    dlo=ceil(ddlo(i));
% this is the case of negative longitude

  end;
  mlo=(ddlo(i)-dlo)*60.;
  dmlo(i)=dlo*100+mlo;
  if dmlo<0;dmlo=-dmlo;end;
  dla=floor(ddla(i)); 

  mla=(ddla(i)-dla)*60.;

  dmla(i)=dla*100+mla;
end;


