I am implementing a model in MATLAB that relies on several functions. All of these functions are dependent on the same set of constants, which currently are defined explicitly in each function (these are all in different m-files). My aim is to run the model several times with different values for the constants, and I'm looking for an easy way to adjust these constants without having to edit all individual functions. I think this may be done using global variables or by defining named constants, but as I've never used any of these methods before I don't know which approach is best or if there is an ever better way to do it.
Edit: One of the functions must remain a single-variable function, and the constants can thus not be passed along as input parameters.
Best Answer