Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Variable holding the name of executing function or script in MATLAB?

Tags:

matlab

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:

  1. One could easily trace the execution of user-defined functions in the command window, e.g. disp(name_of_running_function);

  2. One could conveniently save the (full or partial) memory state of running functions to disk, e.g. save(name_of_running_function, 'all');

Thanks

like image 505
Amelio Vazquez-Reina Avatar asked Nov 21 '25 22:11

Amelio Vazquez-Reina


1 Answers

mfilename: See here. Found through Google.

like image 117
Jonas Heidelberg Avatar answered Nov 23 '25 13:11

Jonas Heidelberg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!