what - List MATLAB files in folder - MATLAB (original) (raw)
List MATLAB files in folder
Syntax
Description
what
lists the path for the current folder and all the MATLAB® relevant files and folders in the current folder. Such files and folders include MATLAB program files (.m
and .mlx
), MAT files, Simulink® model files (.mdl
and .slx
), MEX files, MATLAB app files (.mlapp
), and P-code files, as well as all class and namespace folders.
what [folderName](#bsns%5F5x-folderName)
lists path, file, and folder information for folderName
. You do not need to specify the@
or +
symbol for class and namespace folders. For example, what table
lists the MATLAB files and folders intoolbox/matlab/datatypes/@table
.
[s](#bsns%5F5x-s) = what(___)
returns the results in a structure array. You can use this syntax with any of the input argument combinations in the previous syntaxes.
Examples
List the MATLAB files and folders in the graph2d
folder. The location of this folder depends on your installation.
MATLAB Code files in folder _matlabroot_\toolbox\matlab\graphics\graphics\graph2d
Contents doresize getscribecontextmenu moveaxis putdowntext semilogx texlabel
basicfitdatastat enddrag getscribeobjectdata pan rbbox semilogy zoom
box figtoolset gtext plotedit scribeclearmode setscribecontextmenu
doclick getcolumn jpropeditutils plotyy scribeeventhandler setscribeobjectdata
dokeypress getobj loglog polar scriberestoresavefcns sgtitle
domymenu getorcreateobj middrag prepdrag scribetextdlg subplot
Classes in folder _matlabroot_\toolbox\matlab\graphics\graphics\graph2d
arrowline axisobj editline fighandle hgbin scribehgobj
axischild axistext editrect figobj scribehandle
Namespaces in folder _matlabroot_\toolbox\matlab\bigdatashared\tall\graph2d
qeTallShared
Find the Fixed-Point Designer™ folders that contain MATLAB files.
s =
2×1 struct array with fields:
path
m
mlapp
mlx
mat
mex
mdl
slx
sfx
p
classes
packages
List the SLX files in the_`matlabroot`_\toolbox\fixpoint
folder.
ans =
2×1 cell array
{'fixpoint129PlusTestToolsLib.slx'}
{'fxpRangeInputGenerator.slx' }
Input Arguments
Name of folder, specified as a character vector or string scalar.
For a local folder, you do not need to specify the full path of the folder. Instead, you can specify a relative partial path. For example, what strfun
and what matlab/strfun
both list the MATLAB files in toolbox/matlab/strfun
. However, if the folder is at a remote location, then folderName
must contain a full path specified as a uniform resource locator (URL). For more information, see Work with Remote Data.
The case sensitivity of folderName
is determined by your file system. In general, Windows® and Mac systems are case insensitive and therefore,what
returns results for all case variations offolderName
. For example, suppose the folderc:\mycode
contains the filemyfile.m
on a Windows file system. what
successfully locates the folder even if you specify a different case.
MATLAB Code files in folder c:\mycode myfile
On Linux® systems, which are generally case sensitive,what
returns zero results.
Output Arguments
List of path, files, and folders, returned as a structure array with these fields.
Field | Description |
---|---|
path | Full path to folder |
m | Cell array of MATLAB program file names |
mlapp | Cell array of MATLAB app file names |
mlx | Cell array of MATLAB live script file names |
mat | Cell array of MAT file names |
mex | Cell array of MEX file names |
mdl | Cell array of MDL file names |
slx | Cell array of SLX file names |
sfx | Cell array of SFX file names |
p | Cell array of P-code file names |
classes | Cell array of class folders |
packages | Cell array of namespace folders |
Extended Capabilities
Version History
Introduced before R2006a