Saving reports of multiple simulations to different files

Hi,

I’m running a basic OLG model and want to report the results implied by different values of rho. I tried handling this with a macro-processor loop but I kept getting errors about too many equations for variables. So I did it instead with an Octave loop and the simulations run absolutely fine as they’re supposed to.

However, I tried to do something like this:

for i = 1:4
...
f = "reports" i ".txt"];
dynatype(f);

And all that happens is that Dynatype saves to a file called “f”.

I’d be really grateful if anybody could explain what I’m doing wrong.

Best,
Mike

Shouldn’t it be

Hi, thanks for the response.

The num2str bit is right (I forgot that!) but the file that the simulations save to is still just called “f” (i.e., not what f signifies).

So what happens is that a file called f is created and is overwritten with each simulation. Just need to get dynasave to accept a variable name, if that’s possible.

Thanks again

Try wrapping it into an eval-command:

Thanks so much!