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: FIT_KM.m
    path of file: ./repos/OPEN_FPE_IFT/.previousVersions/V3 Functions
    
    the code of the file until where you have to start completion: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This function performs the surface fit with a linear function for $D^{(1)}\left(u_r,r\right)$ 
% and a parabolic function for $D^{(2)}\left(u_r,r\right)$ to the optimized and non-optimized KMC's.
% Coefficients $d_{ij}(r)$ in the fits are functions of scale~$r$ of the form 
% $\alpha (r/\lambda)^{\beta}+\gamma$. After fitting, this function plots the optimized $D^{(1,2)}$ 
% and its surface fits. This function also plots the parameters $d_{11}$, $d_{20}$, $d_{21}$ and 
% $d_{22}$ as a function of $\frac{r}{\lambda}$ for optimized and non-optimized 
% $D^{(1,2)}\left(u_r,r\right)$.
%
% Arguments IN
% evaluated_point = struct array calculated in the function 'conditional_moment'
% increment_bin = number of bins
% taylor_L = Taylor length scale in meters
% Fs = Acquisition/Sampling Frequency in Hz
% m_data = mean of the data
% markov = markov length in number of samples
% multi_point = weather to do multi-point analysis or not 1=Yes, 0=No
% condition = condition for multi-point analysis
%
% Arguments 
    
function performs the surface fit with a linear function for $D^{(1)}\left(u_r,r\right)$ 
% and a parabolic function for $D^{(2)}\left(u_r,r\right)$ to the optimized and non-optimized KMC's.
% Coefficients $d_{ij}(r)$ in the fits are functions of scale~$r$ of the form 
% $\alpha (r/\lambda)^{\beta}+\gamma$. After fitting, this function plots the optimized $D^{(1,2)}$ 
% and its surface fits. This function also plots the parameters $d_{11}$, $d_{20}$, $d_{21}$ and 
% $d_{22}$ as a function of $\frac{r}{\lambda}$ for optimized and non-optimized 
% $D^{(1,2)}\left(u_r,r\right)$.
%
% Arguments IN
% evaluated_point = struct array calculated in the function 'conditional_moment'
% increment_bin = number of bins
% taylor_L = Taylor length scale in meters
% Fs = Acquisition/Sampling Frequency in Hz
% m_data = mean of the data
% markov = markov length in number of samples
% multi_point = weather to do multi-point analysis or not 1=Yes, 0=No
% condition = condition for multi-point analysis
%
% Arguments OUT
% co_KM_opti = Coefficients $d_{ij}(r)$ of the optimized Kramers-Moyal coefficients using the surface fits
% co_KM_opti_old = Coefficients $d_{ij}(r)$ of the optimized Kramers-Moyal coefficients using the
% surface fits without an offset
% co_no_opti = Coefficients $d_{ij}(r)$ of the non-optimized Kramers-Moyal coefficients using the surface fits
% fitresult_D1_conf = Confidence intervals for fit coefficients of D1
% fitresult_D2_conf = Confidence intervals for fit coefficients of D2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function[co_KM_opti,co_KM_opti_old,co_no_opti,fitresult_D1_conf,fitresult_D2_conf]=FIT_KM(evaluated_point,increment_bin,taylor_L,Fs,m_data,markov,multi_point,condition,save_path)
if multi_point==1
    for k=1:length(condition)
            my_field = sprintf('point_eval_%d', k);              
            co_KM_opti.(my_field)               = struct('a',NaN(1,2),'ea',nan,'b',NaN(1,6),'eb',NaN(1,3));
            co_KM_opti_old.(my_field)           = struct('a',NaN(1,2),'ea',nan,'b',NaN(1,6),'eb',NaN(1,3));
            co_no_opti.(my_field)               = struct('a',NaN(1,2),'ea',nan,'b',NaN(1,6),'eb',NaN(1,3));
    end