This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


List MATLAB files in folder


what folderName
s = what(___)


what lists the path for the current folder and all the MATLAB® relevant files and folders found in the current folder. This includes MATLAB program files (.m and .mlx), MAT-files, Simulink® model files (.mdl and .slx), MEX-files, MATLAB app files (.mlapp), and P-files, as well as all class and package folders.


what folderName lists path, file, and folder information for folderName. You do not need to specify the @ or + symbol for class and package folders. For example, what table lists the MATLAB files and folders in toolbox/matlab/datatypes/@table.


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.


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\graph2d

Contents          figtoolset            loglog       putdowntext            setscribeobjectdata    
axis              getcolumn             middrag      rbbox                  subplot                
basicfitdatastat  getobj                moveaxis     scribeclearmode        texlabel               
box               getorcreateobj        pan          scribeeventhandler     text                   
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            jpropeditutils  plotyy          subplot         zoom            

Classes in folder matlabroot\toolbox\matlab\graph2d

arrowline     axisobj       editline      fighandle     hgbin         scribehgobj   
axischild     axistext      editrect      figobj        scribehandle  

Find the Fixed-Point Designer™ folders that contain MATLAB files.

s = what('fixpoint')
s = 

        path: 'matlabroot\toolbox\fixpoint'
           m: {4x1 cell}
       mlapp: {0x1 cell}
         mat: {0x1 cell}
         mex: {0x1 cell}
         mdl: {0x1 cell}
         slx: {0x1 cell}
           p: {'hasFixedPointDesigner.p'}
     classes: {0x1 cell}
    packages: {'DataTypeWorkflow'}

List the packages in the matlabroot\toolbox\fixpoint folder.

ans = 


Find the supporting files for the DataTypeWorkflow package.

s2 = what('DataTypeWorkflow');
ans = 


Input Arguments

collapse all

Name of folder, specified as a character vector or string scalar.

It is not necessary to give 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.

The case sensitivity of folderName is determined by your file system. In general, Windows® and Mac systems are case insensitive and therefore, exist returns results for all case variations of folderName. For example, suppose the folder c:\mycode containing the file myfile.m exists on a Windows file system. what successfully locates the folder even if the incorrect case is specified.

what MYCodE
MATLAB Code files in folder c:\mycode

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

Data Types: char | string

Output Arguments

collapse all

List of path, files, and folders returned as a structure array with these fields.




Full path to folder


Cell array of MATLAB program file names


Cell array of MLAPP-file names


Cell array of MLX-file names


Cell array of MAT-file names


Cell array of MEX-file names


Cell array of MDL-file names


Cell array of SLX-file names


Cell array of P-file names


Cell array of class folders


Cell array of package folders

See Also

| | | | |

Introduced before R2006a

Was this topic helpful?