Call a function in a sub directory?
43 次查看(过去 30 天)
显示 更早的评论
Suppose a have a folder "folder1" which contains a function "sayhi.m". "folder1" contains a subfolder "subfolder1" which contains an identically named function "sayhi.m".
Is it possible to call both functions from a function in the root folder? Or, how can I override the default call to the local function and force the call of the non-local function?
thanks!
0 个评论
回答(2 个)
Walter Roberson
2019-12-6
cd to the inner directory and create a handle to the function, and cd back. Now when you invoke the handle you get the inner function no matter what your current directory is
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Search Path 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!