By bigbigben:
I guess the problem you run into is because you forgot to save something not changing in the loop in your MAT file.
Well, that was my initial guess too, but the parameters in my mat file are exactly the same as the ones written in the code.
I am attaching the m file and the mat file, though I had to change the extension of the mat file to mod file since the forum won't accept mat extensions. Just change the file extension back to mat in Matlab. If you could have a look at it and possibly run the code with and without the mat file, I will truly appreciate it.
If I can't find a way to do this, I will have to do thousands of runs manually!!!
Thanks so much,
Murat