# Error when running Dynare from matlab

**URL:** <https://forum.dynare.org/t/error-when-running-dynare-from-matlab/3537>\
**Category:** Dynare help (legacy posts)\
**Created:** [3 December 2013 19:42 UTC](https://forum.dynare.org/t/error-when-running-dynare-from-matlab/3537 "2013-12-03T19:42:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor](https://forum.dynare.org/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@Victor](https://forum.dynare.org/u/Victor)\
**Post date:** [3 December 2013 19:42 UTC](https://forum.dynare.org/t/error-when-running-dynare-from-matlab/3537/1 "2013-12-03T19:42:36Z")

</div>

I run a code from matlab to run dynare with 32 parameters. If I run this code with initial parameters, it runs fine but once I re-estimate these parameters I get error ‘Index matrix exceed dimension’ with a report on the (ghx and ghu) matrix I formed being the error. If I run the code with a try command around dynare it runs fine but ignores the matrix I created which doesn’t give me the real results. Help please.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [4 December 2013 09:38 UTC](https://forum.dynare.org/t/error-when-running-dynare-from-matlab/3537/2 "2013-12-04T09:38:58Z")

</div>

Please provide a file tp replicate the issue

---

<div class="post-metadata">

**Author:** ![Victor](https://forum.dynare.org/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@Victor](https://forum.dynare.org/u/Victor)\
**Post date:** [4 December 2013 15:52 UTC](https://forum.dynare.org/t/error-when-running-dynare-from-matlab/3537/3 "2013-12-04T15:52:21Z")

</div>

The matrix error comes from here D=[zeros(nvar,oo\_.dr.nstatic) A(:,1:oo\_.dr.npred) zeros(nvar,oo\_.dr.nfwrd)];  
it says the index matrix exceed dimension when the parameters change but if I use my initial parameters, it runs fine.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [5 December 2013 13:42 UTC](https://forum.dynare.org/t/error-when-running-dynare-from-matlab/3537/4 "2013-12-05T13:42:16Z")

</div>

See [[Getting errors from matlab after running dynare](https://forum.dynare.org/t/getting-errors-from-matlab-after-running-dynare/3545/1))
