How to declare a variable in the "main" script such that it is available to all functions without passing the argument
Show older comments
Hi,
Question: I want to assign variable a value (a constant) in the main workspace, and make it available to all the functions called by this script without passing this particular argument to the functions.
Bigger picture: I typically declare a few variable (and assign them constant value) in the main script, and then pass those to all the functions. However, these values do not change ever.
Thus, I was wondering if it is possible declare these variables in a certain way in the main script such that they are available to all the functions called by the script without actually passing them as arguments to the functions.
Thanks in advance for your help.
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!