Inputting shocks through a loop

Dear all

Is there a way to read in the shock_files in a loop, because I want to do some simulations where I read in the shocks from 1000 different files. I’ve tried using the eval function with a for loop, but this doesn’t seem to work, I think because there is an equals sign in there:

for i=1:10
second=’(shocks_file=shocks’,int2str(i)] ;
third=’)’ ;
eval([first,second,third] );
var eps;
periods 1;
values 0;
format long

Another way I was thinking it might to be able to be done is that if I have one matrix with all shocks in it, can I set for example:

var eps=shock(1,1)

to set eps as the first element of the shock matrix?

I think whenever dynare starts running it clears the workspace so I haven’t been able to do it this way. Is there a way of stopping it clearing the workspace?

Thank you