Hi
I am looking for a good way to set and use the same constant variables across different functions. I have tried to use global, save them in a *.m file and save them in a function. The approach of using global and a *.m file are slower than calling a function. I need a fast solution since I am calling the functions many times and therefore I would like to use the function approach or something faster. However, I have 50+ constants and which makes the code bad to look at when calling it as: [const1, const2, …, const50] = constants()
Furthermore, I do not need all the constants in all programs, but some constants are needed in several different functions so it is not possible just to have several constant functions. I would like to avoid parsing the constants to the functions directly since there are many levels of functions.
Is there are smart way to only get the variables you ask for from a function or is the a smarter way of parsing constants to a function?
Thanks in advance!
Regards Brian.
Best Answer