Is it possible to declare a anonymous function globally?
Show older comments
Hello,
I have a main script-file and various subfunctions (in separate files). In the main script I have declared some anonymous functions like this (but more complex):
test = @(x, y) x * y - x;
test(5, 6)
= 25
How can I globalize these anonymous functions to use them within my separate subfunction-files?
Right now I have to setup all the anonymous functions in each subfunction-file again and again but whenever I adjust one of the anonymous functions, I have to do this for every file. This is quite annoying.
Thank you!
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!