I run a code from matlab to run dynare with some parameters. If I run this code with initial parameters, it runs fine but once I change these parameters I get error 'Index matrix exceed dimension' with a report on the psi matrix I formed
A=oo_.dr.ghx;
E=oo_.dr.ghu;
nvar=size(oo_.dr.order_var);
D=[zeros(nvar,oo_.dr.nstatic) A(:,1:oo_.dr.npred) zeros(nvar,oo_.dr.nfwrd)];
The D matrix being the error. These matrix is extracted from the oo_ output created by dynare first order condition.