Setting parameters outside a mod.file

Hi, everyone!
I want to write a matlab script which involves setting the parameters outside a mod.file by the command ‘set_param_value’, but after I reset the parameters outside the mod file, it would become the same as before when I run the mod file again. It seems that the command ‘set_param_value’ is useless because when I rerun the model, the parameters will be reset to the original values.
How can I get things in the right way?

What exactly are you trying to do? Why do you need to set a parameter outside of a mod-file and then rerun the whole mod-file?

I’m going to calculate the best money policy rule in order to maximize the households’ utility, so I would write a function which takes in policy parameters and gives out the utility value.

But that does still not explain why you need to run all of Dynare again. Usually, you use something like