I’d like to know whether it was possible to do this with Matlab or not.
I have a script that create and initialize a lot of variable. In my main program I call this script to do all the initialization then I go on manipulating the data.
I want to improve that script and make it function-like : I’d like to have different version of my program that will use the slightly different initialized values.
However I can’t do that because I can’t call a script with arguments and if I create a function with that script I won’t recover the context of the function (and I don’t want to modify the script that much so I can return things).
So I’m kinda stuck here. Does anyone know what I should do?
I can suggest a few options:
save. In the script file, you can thenload,and if desired delete the file.globalin front of the desired variables in both the function call, and the scripts):To do the last option: