Load_params_and_steady_state and macro variable

I’m trying to use a macro variable defined when calling dynare

dynare testModel Dxx=4

to load a specific stored set of parameters and steady state values using

load_params_and_steady_state(strcat('testModel_', num2str(@{xx}), '.txt'))

However, load_params_and_steady_state doesn’t seem to accept the matlab strcat output.

Any alternative approach?

Thanks in advance.

is not a Dynare function, so you need to provide it.

Isn’t it?

4. The model file — Dynare 5.4 documentation

I got around this using a loop and copying the txt file before calling dynare, while always keeping the same name for the txt called inside the .mod file:

for iX = 1:length(xx)

    infile = strcat('matfiles/testModel_', num2str(xx(iX)), '.txt');
    copyfile(infile, 'matfiles/testModel.txt');
    dynare testModel nolog % here I always call load_params_and_steady_state('testModel.txt')

end

Sorry, I missed that it’s a preprocessor command. Nevertheless, I am missing the files to reproduce the issue.