How we can only translate .Mod to .Mat file without running?


How we can only translate .Mod to .Mat file without running? For example MyTest.Mod to MyTest.Mat - same structure that Dynate do it automatically.


What do you mean? In principle, when you run Dynare successfully on a mod-file, Dynare will save a _results.mat-file with all structures you will generally need.

that’s true but suppose that i only want m-file. I only want translate mod file to m-file without any other process. Run a code and generate a m-file based on mod file.

After running Dynare once, an m-file with the same name as the mod-file will be created. This is all you need to run.

thank you for answer. That’s true but i only need the translated file without running it. I don’t want the whole process of simulation, estimation and output generating. Only translation is sufficient.

I don’t understand what you exactly want. Please try to describe your objective in full coherent English sentences.

When we run a .mod file, first, dynare translate .mod file to m-file. after automatically run m-file (main process of dynare- initialization, simulation, estimation etc.) and finally show outputs based on the m-file functions. I only want translated file. I don’t want dynare automatically run m-file for main process. Suppose that we have a mod file. After running this mode file I only need a translated m-file beside it. Without any running, processing etc. Only a translator structure not more. I only want this part of total process of dynare.

Ok. Please see the manual on the command line option

Thank you for answer but ‘onlymacro’ command didn’t create any m-file. I need translated m-file.

Sorry, my mistake. I think this is only possible by hacking the dynare.m file currently. If you comment out the last line

it will not run the m-file. However, you have to undo this when you want to use Dynare regularly.

Thank you so much for your helps.