Counterfactual in estimated DSGE model

Hello,
I am trying to apply estimated DSGE model for counterfactual analysis. the problem that I have encountered is that the code that I have created works with calibrated DSGE model, but not for estimated model.

the code that I am using in matlab for simulating counterfactual is the following:

% save baseline
GDP_GAP_v1=oo_.SmoothedVariables.GDP_GAP;
%%

data=‘oo_.SmoothedShocks.’
shocks1=oo_.SmoothedShocks;
names1=fieldnames(shocks1);
shock_names1=string(names1);

for ii=1:length(shock_names1)
shock_basl(:,ii)=eval([data shock_names1{ii}]);
end

shock_basl
vars=oo_.SmoothedVariables;
var_names1=fieldnames(vars);
var_names1=string(var_names1);

data=‘oo_.SmoothedVariables.’
init= zeros(81,length(var_names1))
for ii=1:length(var_names1)
init(:,ii)=eval([data var_names1{ii}]);
end

init=init(1,:)’

%%
y_pic11=simult_(M_,options_,init, oo_.dr, shock_basl,1);

the error i get is :
y_pic11=simult_(M_,options_,init, oo_.dr, shock_basl,1);

Error using simult_
Too many input arguments.

Error in countfact (line 31)
y_pic11=simult_(M_,options_,init, oo_.dr, shock_basl,1);

  1. Which Dynare version are you using?
  2. I would need to see the full files.

I am using dynare 4.5.7. Unfortunatly, I can not share the code publicly becouse its owned by third party.

to clarfy, I am using absolutly same matlab code for counterfactual simulation with calibrated model (solved with dynare 5.1) and with the estimated model which is solved with dynare 4.5.7 and I get error that

Error using simult_
Too many input arguments.

Error in countfact (line 31)
y_pic11=simult_(M_,options_,init, oo_.dr, shock_basl,1);

could it be becouse of dyanre version (4.5.7) or I need to write
simult_ command differnetly when I am using estimated model (comared to calibaretd model)?

The simult_ interface has changed: BreakingFeaturesIn4.6 · Wiki · Dynare / dynare · GitLab

If you cannot share the codes privately, you will need to sort this out yourself.

Thank for your hint! there was syntax problem of the simult_ function in dynare 4.5.7, there is no need of M_, option_ in the input of the command.