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
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