Page 1 of 1

Error using ==> evalin Undefined function or variable 'examp

PostPosted: Fri Sep 28, 2012 3:59 pm
by David
Help!
I am new to Dynare. When I try to run examples in C:\Program Files\dynare\4.3.0\examples, matlab report errors as shown below. I have try other sample mod files in the floder but have same problem. I try both Matlab7.8.0.347 R2009a and Matlab7.14.0.739 R2012a, also try samples in Dynare 4.2.5, but in all case the same erros appear. Please help. Thanks very much.

This is the error reported:

>> dynare example1.mod

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.2.5).
Starting preprocessing of the model file ...
Found 6 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.

??? Error using ==> evalin
Undefined function or variable 'example1'.

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

Re: Error using ==> evalin Undefined function or variable 'e

PostPosted: Fri Sep 28, 2012 4:00 pm
by David
Sorry, my system is Window 7, 32bit.

Re: Error using ==> evalin Undefined function or variable 'e

PostPosted: Sat Sep 29, 2012 7:55 pm
by jpfeifer
You must set you Matlab current folder to the folder that contains the mod-file

Re: Error using ==> evalin Undefined function or variable 'e

PostPosted: Sun Sep 30, 2012 3:59 am
by David
Yes, I have set the right current folder.

>> pwd

ans =

C:\Program Files\dynare\4.3.0\examples

Re: Error using ==> evalin Undefined function or variable 'e

PostPosted: Sun Sep 30, 2012 3:50 pm
by jpfeifer
That won't work. You have installed Dynare in the windows program files folder where Matlab does not have write permission. You need to have the mod-file in a folder where the m-files can be created.

Re: Error using ==> evalin Undefined function or variable 'e

PostPosted: Sun Sep 30, 2012 4:07 pm
by David
jpfeifer wrote:That won't work. You have installed Dynare in the windows program files folder where Matlab does not have write permission. You need to have the mod-file in a folder where the m-files can be created.


Many many thanks to you. I copy the example folder to D drive and it works! Thanks again!