Reputation: 96284
Is there any environment or internal variable in MATLAB that holds the name of the current executing function or workspace?
If not, what would be an easy way of defining this variable for every script/function within a toolbox or folder?
Having such variable always in the workspace would be helpful for debugging, for example:
One could easily trace the execution of user-defined functions in the command window, e.g. disp(name_of_running_function);
One could conveniently save the (full or partial) memory state of running functions to disk, e.g. save(name_of_running_function, 'all');
Thanks
Upvotes: 3
Views: 437