%

% Matlab routine to convert degrees & minutes to decimal degrees

% and make longitude negative
%
% function [latdd,londd]=ddmm2dec(lat,lon)

%

% assume the input lat lon are in ddmm.t format

%

function [latdd,londd]=ddmm2dec(lat,lon)

%

% assume the input lat lon are in ddmm.t format

%

if lat<100;

   disp('Conversion apparently not needed');

   latdd=lat;londd=lon;

else;   

   latdd=floor(lat/100)+(lat-(floor(lat/100)*100))/60.;
   londd=floor(lon/100)+(lon-(floor(lon/100)*100))/60.;

end;   
if londd(1)>0;
  londd=-1*londd;
end;