Main Content

what

List MATLAB files in folder

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 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 in toolbox/matlab/datatypes/@table.

example

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.

example

Examples

collapse all

List the MATLAB files and folders in the graph2d folder. The location of this folder depends on your installation.

what graph2d
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 = what("fixpoint")
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.

s(2).slx
ans =

  2×1 cell array

    {'fixpoint129PlusTestToolsLib.slx'}
    {'fxpRangeInputGenerator.slx'     }

Input Arguments

collapse all

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 of folderName. For example, suppose the folder c:\mycode contains the file myfile.m on a Windows file system. what successfully locates the folder even if you specify a different case.

what MYCodE
MATLAB Code files in folder c:\mycode
myfile

On Linux® systems, which are generally case sensitive, what returns zero results.

Output Arguments

collapse all

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

expand all

Version History

Introduced before R2006a