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: daily_insolation.m
    path of file: ./repos/CDT/cdt
    
    the code of the file until where you have to start completion: function [Fsw,ecc,obliquity,long_perh] = daily_insolation(kyear,lat,day,day_type,varargin)
% daily_insolation computes daily average insolation as a function of day and latitude at
% any point during the past 5 million years.
% 
% This function is from Ian Eisenman and Peter Huybers (see the reference
% below). The daily_insolation function is quite similar to the solar_radiation 
% function, but one may suit your needs better than the other. The daily_insolation 
% function is best suited for investigations involving orbital changes over 
% thousands to millions of years, whereas the solar_radiation may be easier to use

    
function [Fsw,ecc,obliquity,long_perh] = daily_insolation(kyear,lat,day,day_type,varargin)
% daily_insolation computes daily average insolation as a function of day and latitude at
% any point during the past 5 million years.
% 
% This function is from Ian Eisenman and Peter Huybers (see the reference
% below). The daily_insolation function is quite similar to the solar_radiation 
% function, but one may suit your needs better than the other. The daily_insolation 
% function is best suited for investigations involving orbital changes over 
% thousands to millions of years, whereas the solar_radiation may be easier to use
% for applications such as present-day precipitation/drought research. 
% 
%% Syntax 
%  
%  Fsw = daily_insolation(kyear,lat,day)
%  Fsw = daily_insolation(kyear,lat,day,day_type)
%  Fsw = daily_insolation(kyear,lat,day,day_type,'constant',So)
%  Fsw = daily_insolation(kyear,lat,day,day_type,'mjmd')
%  [Fsw, ecc, obliquity, long_perh] = daily_insolation(...)
% 
%% Description
% 
% Fsw = daily_insolation(kyear,lat,day) gives the daily average insolation
% in W/m^2 at latitude(s) lat on specified day(s) of the year (as given by the doy
% function) for the times kyear, which are thousands of years before
% present. For example, use kyear = +3000, to indicate 3 million years
% before present. Maximum allowed value of kyear is 5000. 
% 
% Fsw = daily_insolation(kyear,lat,day,day_type) specifies an optional day
% type as 1 (default) or 2. The default option 1 specifies days in the
% range 1 to 365.24, where day 1 is January first and the vernal equinox
% always occurs on day 80. Option 2 specifies day input as solar longitude
% in the range 0 to 360 degrees. Solar longitude is the angle of the Earth's 
% orbit measured from spring equinox (21 March). Note that calend