function [ initialVariables, initialConstants, iniLoc ] = Initial_SpaceExToStateflow(initial, numVar)
%
% ------------------------------------------------------------------------------
% author: Luan Viet Nguyen
% ------------------------------------------------------------------------------

    initialVariables = ''; %initial states of variables set in cfg file
    initialConstants = ''; %initial states of constants set in cfg file
    i_key = initial.keySet().toArray;
    i_values = initial.values.toArray;
    iniLoc = '';
    if initial.size() > 2
        iniLoc = i_key(1);
        for i_init = 2 : initial.size() 
            if i_init < numVar + 2
                initialVariables = [initialVariables, i_key(i_init),' = ' i_values(i_init) '; '];
            else
                initialConstants = [initialConstants, i_key(i_init),' = ' i_values(i_init) '; '];
            end
        end
    end
end