mfilename is not working for me
17 ビュー (過去 30 日間)
古いコメントを表示
I am trying to get the file name of the lastly invoked mfile using the following command.
a=mfilename('fullpath')
Can anyone tell me where i am committing mistake.!!
I'm working on MATLAB Version 7.13.0.564 (R2011b)
0 件のコメント
回答 (3 件)
Andreas Goser
2013 年 1 月 4 日
The documentation says: "When called from the command line, mfilename returns an empty string."
1 件のコメント
Jan
2013 年 1 月 4 日
@Sudharsan: This means, that your expectations are the mistake. What do you want to obtain in the command line?
Image Analyst
2013 年 1 月 4 日
mfilename only works inside the script when it's running. I don't know that that information on the last m-file that was run is kept, or if it is, if it's available for you to easily get. Maybe it's kept somewhere, though I don't know where. You might try poking around http://undocumentedmatlab.com/
0 件のコメント
Sean de Wolski
2013 年 1 月 4 日
Might be able to get it from the command history:
com.mathworks.mlservices.MLCommandHistoryServices.getSessionHistory
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!