Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

what

List MATLAB files in folder

Syntax

Description

what lists the path for the current folder and all the MATLAB® relevant files and folders found in the current folder. This list includes all files with MathWorks® file extensions except MATLAB live scripts (.mlx). The list also includes all class and package folders. For more information, see MathWorks File Extensions.

example

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.

example

s = what(folderName) returns the results in a structure array.

Examples

collapse all

List Path, File, and Folder Information

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 Supporting Files for Toolbox Package

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.

s.packages
ans = 

    'DataTypeWorkflow'

Find the supporting files for the DataTypeWorkflow package.

s2 = what('DataTypeWorkflow');
s2.p
ans = 

    'DTWRun.p'
    'DiffRunResult.p'
    'DiffSignalResult.p'
    'Result.p'

Input Arguments

collapse all

folderName — Name of folderstring

Name of folder, specified as a string.

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. For more information, see Specify File Names.

Output Arguments

collapse all

s — List of path, files, and foldersstructure array

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 MLAPP-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

p

Cell array of P-file names

classes

Cell array of class folders

packages

Cell array of package folders

See Also

| | | | |

Introduced before R2006a

Was this topic helpful?