Quantcast

Documentation Center

  • Trial Software
  • Product Updates

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, SLX, 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

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

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, R2012b:

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            aufinfo             mmcompinfo          wavplay             
audiodevinfo        auread              mmfileinfo          wavread             
audioinfo           auwrite             movie2avi           wavrecord           
audioplayerreg      avgate              mu2lin              wavwrite            
audioread           avifinfo            prefspanel          
audiorecorderreg    aviinfo             sound               
audiouniquename     aviread             soundsc             
audiowrite          lin2mu              wavfinfo            

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: {77x1 cell}
         mat: {0x1 cell}
         mex: {0x1 cell}
         mdl: {0x1 cell}
         slx: {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'

See Also

| | | | |

Was this topic helpful?