genpath() function doesn't return path names of all subfolders
7 次查看(过去 30 天)
显示 更早的评论
Hi,
I deal with a weird problem of MATLAB 2012a in MAC.
I used genpath() function to get the path names of subfolders in a folder. However, the results don't include all existing subfolders.
Do you know what problem it is? And how to fix it?
Thank you very much.
0 个评论
回答(2 个)
Steven Lord
2017-3-16
Which subfolders are missing from the path? There are certain directories that are not allowed to be on the path, and genpath will not list them. From the documentation for this function in release R2012a:
"The path string does not include folders named private or folders that begin with the @ character (class folders) or the + character (package folders)."
5 个评论
Jan
2017-3-17
This is a job for the debugger: Set a breakpoint in the fist line of genpath and step through the code line by line. Perhaps you have appended user-defined folders on top of the path and Matlab uses a function, which shadows a built-in function. What ever it is, the debugger let you find out the details.
Image Analyst
2017-3-17
Try
addpath(genpath('/Users/Documents/toolbox/mrVista'));
% Optional save for future sessions:
savepath;
Is /Users/Documents/toolbox/mrVista/fileFilters/nifti a hidden folder?
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!