Loading Parameters from External Mat file

Dear all,
I am facing the following problem.
I have a mod file, which I would like to run in a loop where some parameters change in each iteration.
I though that the way to do it was to save the parameters in a XXX.mat file and write load XXX.mat in the mod file, instead of assigning values.
It does not work properly, since the M_.params variable generated is full of NaN.

Do you know how to solve this issue?
Thanks

See [DSGE based-on IRF from VAR's) and an example iterating over Dynare simulations here (see that last zip-file) [code]Need help to check Matlab compatibility]

Yep, seems like that was the problem. Thanks!