How can a function find location of itself?
46 次查看(过去 30 天)
显示 更早的评论
I want to save a file in the same location as the a function (ie not in the current folder). How can a function find get the location of itself?
(the file should handle being moved around, additionally, it will always be in some PATH)
0 个评论
采纳的回答
Walter Roberson
2016-6-13
together with fileparts() to extract the directory portion, and fullfile() to construct the new file name.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Name Construction 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!