How to specify intermediary files directory

how to specify intermediary files directory
Filename.m
Filename_dynamic.m
Filename_static.m

I want all output file to my specify directory

who can help me, thank you!

There’s no internal Dynare way to do this, but you could make a little Matlab function like this:

function chngdir(basename, newdir)

movefile([basename '.m'], newdir);
movefile([basename '_static.m'], newdir);
movefile([basename '_dynamic.m'], newdir);
cd(newdir);

end

Then call this script from within the mod file before the statements that start actual processing, like this:

chngdir('example1', 'myExample1Dir');
stoch_simul;

I want use matlabpool.
but parfor not support cd directory… so dynare can not execute in different directory.
and spmd not support array in Composite’s style.

thank you all the same.

dynare_m.exe create 3 file "deco.m,deco_dynamic.m,deco_static.m"
where find source file about dynare_m.exe? I want to edit and compile.

It’s available from in two forms
git: dynare.org/git/dynare.git/
source snapshot: dynare.org/snapshot/source/

The code you’re looking for is in the preprocessor subdirectory.

We (Dynare developers) do not use matlabpool, so we did not design Dynare with this issue in mind. This might not work at all.

If you find a solution to your problem, please let us know, this can be interesting. You can find Dynare source code and build instructions at: dynare.org/download/dynare-4.2/source

matlabpool not support global Variables.
dynare use global M_ oo_ … for performance reason?

I hope find some version which dynare support parfor or spmd.

We are in the process of removing many global variables, but it is unlikely that we remove all of them.

So I don’t really expect Dynare to be compatible with matlabpool in the forseeable future.

thanks for your reply