mfilename in nested functions
显示 更早的评论
how to output the name of a nested function when it is run. the built-in function mfilename outputs the top function not the nested ones.
回答(1 个)
Daniel Shub
2011-11-15
I think you can use dbstack to get the information. The easiest, although potentially hardest to maintain is to set the "function name" at the top of the function ...
function varargout = mytest(varargin)
functionName = 'mytest';
end
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!