Reputation: 17
For some reason I need to use workspace variables within a function. How can I "import" these variables into my function? Thanks
Upvotes: 0
Views: 499
Reputation: 25140
You can use evalin('caller', ...)
or evalin('base', ...)
to do this, but it is vastly preferable to pass arguments in explicitly.
Upvotes: 1
Reputation: 61
Either pass the variables by argument or (and only seldom recommended) use global variables
Upvotes: 1