Main Content

what

폴더에 있는 MATLAB 파일 나열

설명

what은 현재 폴더의 경로와 현재 폴더에서 검색되는 모든 MATLAB® 관련 파일 및 폴더를 나열합니다. 이것은 MATLAB 프로그램 파일(.m.mlx), MAT 파일, Simulink® 모델 파일(.mdl.slx), MEX 파일, MATLAB 앱 파일(.mlapp), P 파일뿐만 아니라 모든 클래스 폴더와 패키지 폴더도 포함합니다.

예제

what folderNamefolderName에 대한 경로, 파일, 폴더 정보를 나열합니다. 클래스와 패키지 폴더에 대해 @ 또는 + 기호를 지정할 필요가 없습니다. 예를 들어, what tabletoolbox/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은 URL(Uniform Resource Locator)로 지정된 전체 경로를 포함해야 합니다. 자세한 내용은 원격 데이터로 작업하기 항목을 참조하십시오.

folderName의 대/소문자 구분은 파일 시스템에 의해 결정됩니다. 일반적으로 Windows® 시스템과 Mac 시스템은 대/소문자를 구분하지 않으므로, whatfolderName의 모든 대/소문자 변동에 대한 결과를 반환합니다. 예를 들어, 파일 myfile.m이 포함된 폴더 c:\mycode가 Windows 파일 시스템에 있다고 가정해 보겠습니다. what은 잘못된 대/소문자가 지정된 경우에도 해당 폴더를 성공적으로 찾습니다.

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

일반적으로 대/소문자를 구분하는 Linux® 시스템에서는 결과 0이 반환됩니다.

출력 인수

모두 축소

경로, 파일 및 폴더의 목록으로, 다음 필드를 포함하는 구조체 배열로 반환됩니다.

필드

설명

path

폴더의 전체 경로

m

MATLAB 프로그램 파일 이름으로 구성된 셀형 배열

mlapp

MLAPP 파일 이름으로 구성된 셀형 배열

mlx

MLX 파일 이름으로 구성된 셀형 배열

mat

MAT 파일 이름으로 구성된 셀형 배열

mex

MEX 파일 이름으로 구성된 셀형 배열

mdl

MDL 파일 이름으로 구성된 셀형 배열

slx

SLX 파일 이름으로 구성된 셀형 배열

sfx

SFX 파일 이름으로 구성된 셀형 배열

p

P 파일 이름으로 구성된 셀형 배열

classes

클래스 폴더로 구성된 셀형 배열

packages

패키지 폴더로 구성된 셀형 배열

확장 기능

버전 내역

R2006a 이전에 개발됨

참고 항목

| | | | |