Getting m-file into mod-file

Dear all,

I have a large model with hundreds of parameters and I would like to set the parameter values in a separate file (preferably an m-file) instead of in the mod-file directly.
However, it seems that the mod-file in dynare version 4 does not read m-files. Is that right? If not, could you please tell me how I could proceeed?

My best regards and many thanks for you help.


p.s.: I’ve already tried saving the parameter values in the m-file (using the command “save filename”) and then loading them into the mod-file (using the command “load filename”). Even though this works, this solution is not that good for my purposes.

Is this separate m-file containing steady state values of your model? If so, the mod-file automatically reads it before the command steady every time, by checking the directory where the mod-file is saved for a file called nameofthemodfile_steadystate.m, if this m-file does not contain the steady state values maybe there is still a similar way to do it


I think you could simply you a scalar-valued Matlab function to input your parameter in a mod.-file. This definitely works, but you might want to automatize the process of creating the functions first. Anyway, try something along these lines:


where you have a separate m.file containing

function output=my_function;