You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dms2deg.m
    path of file: ./repos/mpsim/lib/util/angle
    
    the code of the file until where you have to start completion: function ddeg=dms2deg(dms)
%
% Function dms2deg
% ================
%
%       Converts angles in the format gg.mmsssssssss to decimal degrees.
%
% Sintax
% ======
%
%       ddeg=dms2deg(dms)
%
% Input
% =====
%
%       dms -> angle in the format gg.mmsssssssss
%
% Output
% ======
%
%       ddeg -> angle in decimal degrees
%
% Created/Modified
% ================
%
% When          Who                     What
% ----          ---                     ----
% 2006/06/28    Rodrigo Leandro         Function created
%
%
% ==============================

    
function ddeg=dms2deg(dms)
%
% Function dms2deg
% ================
%
%       Converts angles in the format gg.mmsssssssss to decimal degrees.
%
% Sintax
% ======
%
%       ddeg=dms2deg(dms)
%
% Input
% =====
%
%       dms -> angle in the format gg.mmsssssssss
%
% Output
% ======
%
%       ddeg -> angle in decimal degrees
%
% Created/Modified
% ================
%
% When          Who                     What
% ----          ---                     ----
% 2006/06/28    Rodrigo Leandro         Function created
%
%
% ==============================
% Copyright 2006 Rodrigo Leandro
% ==============================

%=======================
% 1. Get sign of angle
%-----------------------
sig=sign(dms);
dms=abs(dms);
%=======================

%====================================
% 2. Get degrees, minutes and seconds
%------------------------------------
deg=fix(dms);
% k is the largest value in seconds 
% that can be added to a valid value in 
% seconds ([0 60]) without making the sum 
% greater than 1 minute, all of it in the 
% dms representation:
k = 0.0100 - 0.0060 - sqrt(eps);
min1=(dms-deg)*100 + k;
min=fix(min1);
sec=mod(min1,min)*100;
sec=sec-100*k;
%====================================

%=============================
% 3. Compute angle in degrees:
%-----------------------------
ddeg=sig.*(deg+min/60+sec/3600);
%=============================

end