Page 1 of 1

how to run a '.mod' file?

PostPosted: Sat Feb 23, 2013 11:11 am
by zahra2309
I use dynare 4.2.2 .
I create .m file then i write my script and then i save the m file as .mod file. but the run button is not active! so how can i run this file?
in addition after saving the .m file as .mod file the codes like end , global,... are not active(blue)!
please help me!

Re: how to run a '.mod' file?

PostPosted: Sat Feb 23, 2013 1:57 pm
by jpfeifer
Set a path in Matlab to the dynare\matlab subfolder. Set the Matlab Active Path to the folder where your mod-file is stored. Then type into the Matlab command window:
Code: Select all
dynare name_of_the_mode_file

See also Chapter 3 of the Dynare manual.

Re: how to run a '.mod' file?

PostPosted: Sun Mar 03, 2013 7:01 am
by zahra2309
Hi
Thank you.I did all of this but it didnot work and I could not run the file!

Re: how to run a '.mod' file?

PostPosted: Fri Mar 08, 2013 1:57 pm
by SébastienVillemot
What is the error message?

Re: how to run a '.mod' file?

PostPosted: Mon Mar 11, 2013 7:48 am
by zahra2309
when I type this command:
Dynare myfile.mod
Matlab showes this error:
Error using==> dynare at 96
DYNARE: can't open my.mod

Re: how to run a '.mod' file?

PostPosted: Mon Mar 11, 2013 8:13 am
by jpfeifer
This means that Dynare cannot find you mod-file. Make sure that the mod-file you saved is in the curent Matlab-Path.

Re: how to run a '.mod' file?

PostPosted: Wed Mar 13, 2013 9:29 am
by zahra2309
yes, I know this so I change my directory several times, but it does not work!
Inaddition when I open a .mod file directly without any command, Matlab shows that mentioned error massage too!

Re: how to run a '.mod' file?

PostPosted: Mon May 27, 2013 10:41 am
by zahra2309
zahra2309 wrote:yes, I know this so I change my directory several times, but it does not work!
Inaddition when I open a .mod file directly without any command, Matlab shows that mentioned error massage too!


I found the problem finally!
any way, I appreciate all your help!

Re: how to run a '.mod' file?

PostPosted: Thu Feb 25, 2016 8:52 pm
by lelos
Hi, Could you please post the solution to your problem ??

Cause it seems I have the same problem. Although I add the folder and the subforlder of my .mod file in my path, and of course the dynare\matlab folder, matlab cannot open the mod file.:

Starting Dynare (version 4.4.3).
Starting preprocessing of the model file ...
ERROR: Could not open file: DSGE_1.mod

I desperately dont know how to fix that. It seems very stupid since I am wasting time doing the same thing and reading the manual's instruction 1000000 times.

Any idea please??
Thank you

Re: how to run a '.mod' file?

PostPosted: Thu Feb 25, 2016 9:12 pm
by lelos
Issue just resolved.

For those who may face the same problem in the future, when you want to add your .mod file in Matlab's current folder, do not right-click and press "Add folder and subfolder" !! Just double left click on the folder of your .mod file. Thats how it worked for me.