function fval = RAMSEY_FILE_endoss(variablesguess,instr1,instr2)


global M_ 

%% assign variables and parameter values 

num_variablesguess=size(variablesguess,1);
for idxxx=1:1:num_variablesguess
    define_string=[M_.endo_names_reduced(idxxx,:),'=',sprintf('%20.20g',variablesguess(idxxx))];
    evalc(define_string);
end

if isnan(M_.params(:,:))==0
    %read parameter values from M_.params and assign to parameters names.
    %this overwrites parameters coming from params.m if estimation is done.
    num_para=size(M_.params,1);
    for idxxx=1:1:num_para
        define_string=[M_.param_names(idxxx,:),'=',sprintf('%20.20g',M_.params(idxxx))];
        evalc(define_string);
    end
end
