Discretionary_policy check problem

Hy everyone,

I am facing a problem with my code for optimal policy under discretion when I add the “check” command at the end of the mod file.
Everything else seems to run fine (note that you need to run the code with an unstable version of Dynare since there was a bug with
the “discretionary_policy” command in Dynare 4.3.0). More specifically, following errors are reported:

??? Attempted to access y(37); index out of bounds because numel(y)=36.

Error in ==> discr_dynamic at 44
rhs =y(37);

Error in ==> stochastic_solvers at 89
[junk,jacobia_] = feval([M_.fname ‘_dynamic’],z(iyr0),exo_simul, …

Error in ==> resol at 118
[dr,info] = stochastic_solvers(dr,check_flag,M,options,oo);

Error in ==> check at 71
[dr,info,M,options,oo] = resol(1,M,options,oo);

Error in ==> discr at 206
check(M_,options_,oo_);

Error in ==> dynare at 120
evalin(‘base’,fname) ;

In the attachment you can find the .mod file of my code.

Thank you very much in advance and best regards,
Francis
discr.mod (1010 Bytes)