I have two functions in matlab, which roughly look like this
function f1()
setup_callback(@f2);
a = 1;
evaluate_callback();
end
function f2()
...
end
where evaluate_callback is an external library function which calls f2.
I want to be able to read the current value of a from inside f2. Is there some way to achieve this without using globals?