pathsep
适用于当前平台的搜索路径分隔符
说明
示例
获取路径名称中的子文件夹列表
将 genpath
与 regexp
和 pathsep
结合使用,获取路径名称中各个文件夹的列表。
创建一个文件夹 myfolder
,其中包含子文件夹 mysubfolder
。
mkdir myfolder; cd myfolder; mkdir mysubfolder; cd ..
生成一个路径名称,其中包含 myfolder
及其所有下级文件夹。
p = genpath('myfolder')
p = 'myfolder:myfolder/mysubfolder:'
使用 regexp
函数将该路径拆分为单个文件夹。
s = regexp(p, pathsep, 'split')
s = 1x3 cell
{'myfolder'} {'myfolder/mysubfolder'} {0x0 char}
扩展功能
C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。
用法说明和限制:
基于您用于代码生成的 MATLAB® 版本返回路径分隔符。
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
版本历史记录
在 R2006a 之前推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)