Hi!
I have some numbers defined in the main script whose values are constant during all the simulation.
During the execution of the main I call several functions which take as input some variables and the same numbers defined before and as output some results, the problem is that passing all the numbers as parameters to the functions is quite annoying. Is there a way to bypass this? I tried with some global variables but it doesn't seem to work, I might have made some mistakes with declarations…
For Example (with only one number but I have many of them):
offset = 1;result = myFunc(3)%%%%%
function res = myFunc(val)res = val + offset;
Best Answer