开发者

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

开发者 https://www.devze.com 2023-02-22 22:39 出处:网络
Is there any environment or int开发者_如何学编程ernal variable in MATLAB that holds the name of the current executing function or workspace?

Is there any environment or int开发者_如何学编程ernal 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


mfilename: See here. Found through Google.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号