genpath genpath directory p = genpath(‘directory‘)
D:\Ccode; D:\Ccode\OpenCV_test; D:\Ccode\OpenCV_test\Debug; D:\Ccode\OpenCV_test\OpenCV_test; D:\Ccode\OpenCV_test\OpenCV_test\Debug; D:\Ccode\OpenCV_test\images;D:\Ccode\Opencv_Event; D:\Ccode\Opencv_Event\Debug;D:\Ccode\Opencv_Event\Opencv_Event; D:\Ccode\Opencv_Event\Opencv_Event\Debug; D:\Ccode\STL; D:\Ccode\STL\Debug; D:\Ccode\STL\STL; D:\Ccode\STL\STL\Debug;
f = fullfile(‘C:‘, ‘Applications‘, ‘matlab‘, ‘myfun.m‘) f = C:\Applications\matlab\myfun.m
file = ‘\home\user4\matlab\classpath.txt‘; [pathstr, name, ext, versn] = fileparts(file) pathstr = \home\user4\matlab name = classpath ext = .txt versn = ‘‘
MATLAB基本操作(七):有关文件路径的几个函数在编程中的作用
原文:http://blog.csdn.net/jxlijunhao/article/details/18366223