what
列出文件夹中的 MATLAB 文件
说明
what
列出当前文件夹的路径以及在当前文件夹中找到的与 MATLAB® 相关的所有文件和文件夹。这包括 MATLAB 程序文件(.m
和 .mlx
)、MAT 文件、Simulink® 模型文件(.mdl
和 .slx
)、MEX 文件、MATLAB App 文件 (.mlapp
)、P 文件以及所有的类文件夹和包文件夹。
what
列出 folderName
folderName
的路径、文件和文件夹信息。您无需为类和包文件夹指定 @
或 +
符号。例如,what table
列出 toolbox/matlab/datatypes/@table
中的 MATLAB 文件和文件夹。
示例
列出路径、文件和文件夹信息
列出 graph2d
文件夹中的 MATLAB 的文件和文件夹。此文件夹的位置取决于您的安装情况。
what graph2d
MATLAB Code files in folder matlabroot\toolbox\matlab\graph2d Contents figtoolset loglog putdowntext setscribeobjectdata axis getcolumn middrag rbbox sgtitle basicfitdatastat getobj moveaxis scribeclearmode subplot box getorcreateobj pan scribeeventhandler texlabel doclick getscribecontextmenu plot scriberestoresavefcns title dokeypress getscribeobjectdata plotedit scribetextdlg xlabel domymenu grid plotyy semilogx ylabel doresize gtext polar semilogy zoom enddrag jpropeditutils prepdrag setscribecontextmenu P-files in folder matlabroot\toolbox\matlab\graph2d axis sgtitle subplot zoom Classes in folder matlabroot\toolbox\matlab\graph2d arrowline axisobj editline fighandle hgbin scribehgobj axischild axistext editrect figobj scribehandle
查找工具箱包的支持文件
查找包含 MATLAB 文件的 Fixed-Point Designer™ 文件夹。
s = what('fixpoint')
s = struct with fields: path: 'matlabroot\toolbox\fixpoint' m: {4×1 cell} mlapp: {0×1 cell} mlx: {0×1 cell} mat: {0×1 cell} mex: {0×1 cell} mdl: {0×1 cell} slx: {0×1 cell} sfx: {0×1 cell} p: {4×1 cell} classes: {0×1 cell} packages: {5×1 cell}
列出
文件夹中的包。matlabroot
\toolbox\fixpoint
s.packages
ans = 5×1 cell array {'DataTypeOptimization' } {'DataTypeWorkflow' } {'FunctionApproximation'} {'IRInstrumentation' } {'cpopt' }
查找 DataTypeWorkflow
包的支持文件。
s2 = what('DataTypeWorkflow');
s2.p
ans = 6×1 cell array {'DTWRun.p' } {'RangeCollectionMode.p' } {'Result.p' } {'VerificationResult.p' } {'findDecoupledSubsystems.p'} {'hyperlink.p' }
输入参数
folderName
— 文件夹名称
字符向量 | 字符串标量
文件夹的名称,指定为字符向量或字符串标量。
对于本地文件夹,不需要给出文件夹的完整路径。相反,您可以指定相对部分路径。例如,what strfun
和 what matlab/strfun
都列出了 toolbox/matlab/strfun
中的 MATLAB 文件。但是,如果该文件夹位于远程位置,则 folderName
必须包含指定为统一资源定位器 (URL) 的完整路径。有关详细信息,请参阅处理远程数据。
folderName
是否区分大小写由您的文件系统决定。一般来说,Windows® 和 Mac 系统不区分大小写,因此 what
会为 folderName
的各种大小写变体都返回结果。例如,假设 Windows 文件系统上存在包含文件 myfile.m
的文件夹 c:\mycode
。即使指定错误的大小写,what
也能成功找到该文件夹。
what MYCodE
MATLAB Code files in folder c:\mycode myfile
在 Linux® 系统上,通常区分大小写,因此 what 将返回零个结果。
输出参数
s
— 路径、文件和文件夹的列表
结构体数组
路径、文件和文件夹的列表,以包含以下字段的结构体数组形式返回。
字段 | 说明 |
---|---|
| 文件夹的完整路径 |
| MATLAB 程序文件名的元胞数组 |
| 包含 MLAPP 文件名称的元胞数组 |
mlx | 包含 MLX 文件名称的元胞数组 |
| 包含 MAT 文件名称的元胞数组 |
| 包含 MEX 文件名称的元胞数组 |
| 包含 MDL 文件名称的元胞数组 |
| 包含 SLX 文件名称的元胞数组 |
| 包含 SFX 文件名称的元胞数组 |
| 包含 P 文件名称的元胞数组 |
| 包含类文件夹的元胞数组 |
| 包含程序包文件夹的元胞数组 |
扩展功能
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
此函数完全支持基于线程的环境。有关详细信息,请参阅Run MATLAB Functions in Thread-Based Environment。
版本历史记录
在 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)