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

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) ;

Sorry, my system is Window 7, 32bit.

You must set you Matlab current folder to the folder that contains the mod-file

Yes, I have set the right current folder.


ans =

C:\Program Files\dynare\4.3.0\examples

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!