Skip to Main Content Skip to Search
Product Documentation

what - List MATLAB files in folder

Syntax

what
what folderName
what className
what packageName
s = what('folderName')

Description

what lists the path for the current folder, and lists all files and folders relevant to MATLAB found in the current folder. Files listed are M, MAT, MEX, MDL, and P-files. Folders listed are all class and package folders.

what folderName lists path, file, and folder information for folderName.

what className lists path, file, and folder information for method folder @className. For example, what cfit lists the MATLAB files and folders in toolbox/curvefit/curvefit/@cfit.

what packageName lists path, file, and folder information for package folder +packageName. For example, what commsrc lists the MATLAB files and folders in toolbox/comm/comm/+commsrc.

s = what('folderName') returns the results in a structure array with the fields shown in the following table.

Field

Description

path

Path to folder

m

Cell array of MATLAB program file names

mat

Cell array of MAT-file names

mex

Cell array of MEX-file names

mdl

Cell array of MDL-file names

p

Cell array of P-file names

classes

Cell array of class folders

packages

Cell array of package folders

Examples

List the MATLAB files and folders in C:\Program Files\MATLAB\Rnnnn\toolbox\matlab\audiovideo\+audiovideo, where Rnnnn represents the folder for the MATLAB release, for example, R2012a:

what audiovideo

MATLAB Code files in folder C:\Program Files\MATLAB\Rnnnn\toolbox\matlab\audiovideo\+audiovideo

FileFormatInfo    

Packages in folder C:\Program Files\MATLAB\Rnnnn\toolbox\matlab\audiovideo\+audiovideo

internal  writer    


MATLAB Code files in folder C:\Program Files\MATLAB\Rnnnn\toolbox\matlab\audiovideo

Contents            avifinfo            sound  
audiodevinfo        aviinfo             soundsc
audioplayerreg      aviread             wavfinfo
audiorecorderreg    lin2mu              wavplay
audiouniquename     mmcompinfo          wavread
aufinfo             mmfileinfo          wavrecord
auread              movie2avi           waywrite
auwrite             mu2lin
avgate              prefspanel

MAT-files in folder C:\Program Files\MATLAB\Rnnnn\toolbox\matlab\audiovideo

chirp         handel          splat
gong          laughter        train

Classes in folder C:\Program Files\MATLAB\Rnnnn\toolbox\matlab\audiovideo

VideoReader    audioplayer    avifile        
VideoWriter    audiorecorder  mmreader       

Packages in folder C:\Program Files\MATLAB\Rnnnn\toolbox\matlab\audiovideo

audiovideo
 

Obtain a structure array containing the file and folder names in toolbox/matlab/codetools that are relevant to MATLAB, where Rnnnn represents the folder for the MATLAB release, for example, R2012a:

s = what('codetools')

s = 

        path: 'C:\Program Files\MATLAB\Rnnnn\toolbox\matlab\codetools'
           m: {76x1 cell}
         mat: {0x1 cell}
         mex: {0x1 cell}
         mdl: {0x1 cell}
           p: {0x1 cell}
     classes: {2x1 cell}
    packages: {3x1 cell}
 

Find the supporting files for one of the packages in the Communications System Toolbox product:

p1 = what('comm');
p1.packages
ans = 

    'gpu'
    'internal'


ans = 

    'internal'.
.
.
p2 = what('commsrc');
p2.m
ans = 
    'abstractJitter.m'
    'abstractPulse.m'
    'combinedjitter.m'
    'diracjitter.m'
    'periodicjitter.m'
    'randomjitter.m'

Alternatives

Use the Current Folder browser to view the list of files in a folder.

See Also

dir | exist | lookfor | ls | which | who

How To

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS