フィルターのクリア

mfilename in nested functions

2 ビュー (過去 30 日間)
Matlaboscope
Matlaboscope 2011 年 11 月 15 日
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
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

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by