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!