mfilename is not working for me
이전 댓글 표시
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)
답변 (3개)
Andreas Goser
2013년 1월 4일
2 개 추천
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일
0 개 추천
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/
Sean de Wolski
2013년 1월 4일
Might be able to get it from the command history:
com.mathworks.mlservices.MLCommandHistoryServices.getSessionHistory
카테고리
도움말 센터 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!