Getting name of the running script from inside the class.
2 ビュー (過去 30 日間)
古いコメントを表示
I know that normally you can use mfilename to find the name and address of the file currently running.
I need something a little different: I need the name of the file constructing an instance of the class. I need that filename inside the class body (and of course I want to avoid adding additional argument for passing that filename.)
If I use mfilename inside the class it will obviously return class file which is not useful for me. dbstack seems to be my only option but I don't like it since it seems like the function was not intended for this use case.
Thanks.
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Argument Definitions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!