Main Content

what

フォルダー内の MATLAB ファイルの一覧表示

説明

what は、現在のフォルダーのパスと、現在のフォルダーにある MATLAB® 関連のすべてのファイルおよびフォルダーを一覧表示します。これには、MATLAB プログラム ファイル (.m および .mlx)、MAT ファイル、Simulink® モデル ファイル (.mdl および .slx)、MEX ファイル、MATLAB アプリ ファイル (.mlapp)、P ファイル、およびすべてのクラスとパッケージ フォルダーが含まれます。

what folderName は、folderName のパス、ファイルおよびフォルダー情報を一覧表示します。クラスおよびパッケージ フォルダーに @+ 記号を指定する必要はありません。たとえば、what table は、toolbox/matlab/datatypes/@table にある MATLAB ファイルとフォルダーを一覧表示します。

s = what(___) は、結果を構造体配列として返します。この構文では、前述の構文の入力引数を任意に組み合わせて使用できます。

すべて折りたたむ

graph2d フォルダー内の MATLAB ファイルおよびフォルダーの一覧を表示します。このフォルダーの場所はインストールによって異なります。

what graph2d
MATLAB Code files in folder matlabroot\toolbox\matlab\graph2d

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

Classes in folder matlabroot\toolbox\matlab\graph2d

arrowline     axisobj       editline      fighandle     hgbin         scribehgobj   
axischild     axistext      editrect      figobj        scribehandle  

MATLAB ファイルを含む Fixed-Point Designer™ フォルダーを検索します。

s = what('fixpoint')
s = 

  struct with fields:

        path: 'matlabroot\toolbox\fixpoint'
           m: {4×1 cell}
       mlapp: {0×1 cell}
         mlx: {0×1 cell}
         mat: {0×1 cell}
         mex: {0×1 cell}
         mdl: {0×1 cell}
         slx: {0×1 cell}
         sfx: {0×1 cell}
           p: {4×1 cell}
     classes: {0×1 cell}
    packages: {5×1 cell}

matlabroot\toolbox\fixpoint フォルダー内のパッケージを一覧表示します。

s.packages
ans =

  5×1 cell array

    {'DataTypeOptimization' }
    {'DataTypeWorkflow'     }
    {'FunctionApproximation'}
    {'IRInstrumentation'    }
    {'cpopt'                }

DataTypeWorkflow パッケージのサポート ファイルを検索します。

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

  6×1 cell array

    {'DTWRun.p'                 }
    {'RangeCollectionMode.p'    }
    {'Result.p'                 }
    {'VerificationResult.p'     }
    {'findDecoupledSubsystems.p'}
    {'hyperlink.p'              }

入力引数

すべて折りたたむ

フォルダーの名前。文字ベクトルまたは string スカラーとして指定します。

ローカル フォルダーの場合、フォルダーの絶対パスを指定する必要はありません。代わりに相対的な部分パスを指定できます。たとえば、what strfunwhat matlab/strfun のいずれを使用しても、toolbox/matlab/strfun にある MATLAB ファイルの一覧が表示されます。しかし、フォルダーがリモートの場所にある場合、folderName には Uniform Resource Locator (URL) の形式で指定された絶対パスを含めなければなりません。詳細については、リモート データの操作を参照してください。

folderName で大文字と小文字が区別されるかどうかは、使用するファイル システムで決まります。一般に、Windows®Mac のシステムでは大文字と小文字が区別されないため、whatfolderName のすべての大文字と小文字の組み合わせについての結果を返します。たとえば、Windows ファイル システムでフォルダー c:\mycode にファイル myfile.m が格納されているとします。what は、大文字と小文字の指定が間違っていてもフォルダーを正しく特定します。

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

Linux® システムでは、一般に大文字と小文字が区別されるため、what の結果はゼロになります。

出力引数

すべて折りたたむ

パス、ファイルおよびフォルダーのリスト。次のフィールドから成る構造体配列として返されます。

フィールド

説明

path

フォルダーの絶対パス

m

MATLAB プログラム ファイル名の cell 配列

mlapp

MLAPP ファイル名の cell 配列

mlx

MLX ファイル名の cell 配列

mat

MAT ファイル名の cell 配列

mex

MEX ファイル名の cell 配列

mdl

MDL ファイル名の cell 配列

slx

SLX ファイル名の cell 配列

sfx

SFX ファイル名の cell 配列

p

P ファイル名の cell 配列

classes

クラス フォルダーの cell 配列

packages

パッケージ フォルダーの cell 配列

拡張機能

バージョン履歴

R2006a より前に導入