How to run a '.mod' file?

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!

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:

See also Chapter 3 of the Dynare manual.

Hi
Thank you.I did all of this but it didnot work and I could not run the file!

What is the error message?

when I type this command:
Dynare myfile.mod
Matlab showes this error:
Error using==> dynare at 96
DYNARE: can’t open my.mod

This means that Dynare cannot find you mod-file. Make sure that the mod-file you saved is in the curent Matlab-Path.

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!

[quote=“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![/quote]

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

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

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.